Results 1 to 4 of 4

Thread: Is there a way to bash script a reboot with a cheatcode?

  1. #1
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    Is there a way to bash script a reboot with a cheatcode?

    Is there a bash command that I can use in a script to shut down a LiveUSB
    Knoppix session which is using persistence and automatically rebooting
    that Knoppix with the cheatcode 'noimage', for example?

  2. #2
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    Of course, you can write such a script which manipulates '/mnt-system/boot/syslinux/syslinux.cfg'.
    Code:
    myreboot noimage
    look with "grep" if 'syslinux.cfg' contains the word "noimage"; if not, insert it with "sed", else do nothing.
    And you need the other way
    Code:
    myreboot !noimage
    look with "grep" if 'syslinux.cfg' contains the word "noimage"; if so, delete it with "sed", else do nothing.

    But why expend so much time to develop such a script; it's easier to work on 'syslinux.cfg' with mcedit or leafpad if you really need it some time.

  3. #3
    Senior Member registered user
    Join Date
    Sep 2006
    Posts
    802
    An alternative, and for me simpler, approach is to use a bootloader. I use old legacy GRUB, and there you can easily use a noimage boot alternative as the default. Which of course lets you override that manually. If you want a flip mechanism, you may set and manipulate the default alternative, principally the same way as Werner describes with syslinux boot.

  4. #4
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    Greetings, Werner & Capricorny.

    Thank you both for your suggestions.

    I have implemented a workable manipulation of the DEFAULT line in
    syslinux.cfg adequate to my purposes.
    I now have a working bash script to facilitate stacking compressed
    images ala Klaus K's CeBIT scheme.
    I also found Werner's menu management scheme of organization and use
    of 'dialogs' very useful to build upon.

    After I use this a while to catch some of my errors, I'll post it
    for your comments.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Ubuntu Server 26.04.1 LTS Bootable USB Flash Drive – Latest September 2026 picture

Ubuntu Server 26.04.1 LTS Bootable USB Flash Drive – Latest September 2026

$12.99



NVIDIA Jetson TK1 + Intel NUC Compute Cluster Tray w/ Netgear 16-Port Switch picture

NVIDIA Jetson TK1 + Intel NUC Compute Cluster Tray w/ Netgear 16-Port Switch

$499.99



OPNsense pfSense 8-Core Atom C3758 2.2GHz 8GB DDR4 64GB SSD 8x NIC QAT AES VPN picture

OPNsense pfSense 8-Core Atom C3758 2.2GHz 8GB DDR4 64GB SSD 8x NIC QAT AES VPN

$115.00



VA Linux 1120 1U Rackmount Server picture

VA Linux 1120 1U Rackmount Server

$100.00



OPNsense Firewall VPN QAT 8-Core Atom C3758 2.20GHz 16GB DDR4 128GB SSD 8xNIC picture

OPNsense Firewall VPN QAT 8-Core Atom C3758 2.20GHz 16GB DDR4 128GB SSD 8xNIC

$175.00



All New Ubuntu 26.04 LTS Linux Bootable USB Flash Drive picture

All New Ubuntu 26.04 LTS Linux Bootable USB Flash Drive

$15.95



Start9 Server Pure 32GB 4TB Intel i7 Node StartOS — Box + PSU picture

Start9 Server Pure 32GB 4TB Intel i7 Node StartOS — Box + PSU

$649.00



Linux 5.2 The Complete Redhat Operating System Deluxe Secure Server 3 CD Book picture

Linux 5.2 The Complete Redhat Operating System Deluxe Secure Server 3 CD Book

$37.49



BOSGAME E4 Air Mini PC, AMD Ryzen 5 3500U 8GB DDR4 256GB SATA SSD picture

BOSGAME E4 Air Mini PC, AMD Ryzen 5 3500U 8GB DDR4 256GB SATA SSD

$169.99



SQL Server 2022 Enterprise 96 Core License & DVD Unlimited CALs with CoA picture

SQL Server 2022 Enterprise 96 Core License & DVD Unlimited CALs with CoA

$284.99