Results 1 to 4 of 4

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

Hybrid View

  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
  •  


GIGABYTE A520M DS3H AC AMD AM4 Motherboard mATX picture

GIGABYTE A520M DS3H AC AMD AM4 Motherboard mATX

$59.99



Intel H310 LGA1151 8-9th Gen DDR4 M.2 NVMe mATX Motherboard IO Shield Battery picture

Intel H310 LGA1151 8-9th Gen DDR4 M.2 NVMe mATX Motherboard IO Shield Battery

$54.99



Dell Precision 3650 Tower Intel LGA 1200 DDR4 Desktop Motherboard NDYHG picture

Dell Precision 3650 Tower Intel LGA 1200 DDR4 Desktop Motherboard NDYHG

$59.99



ASUS B85M-G/B85M-G PLUS LGA1150 DDR3 Micro ATX Motherboard HDMI for Inter 4thCPU picture

ASUS B85M-G/B85M-G PLUS LGA1150 DDR3 Micro ATX Motherboard HDMI for Inter 4thCPU

$45.00



⁠Intel H81 Motherboard M.2 NVMe LGA 1150 mATX w/ IO Shield (Random Slot Color)⁠ picture

⁠Intel H81 Motherboard M.2 NVMe LGA 1150 mATX w/ IO Shield (Random Slot Color)⁠

$29.90



GIGABYTE B365 HD3 LGA1151 Intel 9th Gen motherboard picture

GIGABYTE B365 HD3 LGA1151 Intel 9th Gen motherboard

$59.99



ASRock B550M PRO4 AM4 AMD B550 SATA 6Gb/s Micro ATX AMD Motherboard picture

ASRock B550M PRO4 AM4 AMD B550 SATA 6Gb/s Micro ATX AMD Motherboard

$76.49



MSI B550M PRO-VDH Micro-ATX Motherboard - AMD AM4, Ryzen 5000/4000/3000 Ready, P picture

MSI B550M PRO-VDH Micro-ATX Motherboard - AMD AM4, Ryzen 5000/4000/3000 Ready, P

$101.99



MSI PRO Z790-P WIFI DDR4 LGA 1700 Intel Z790 SATA 6Gb/s DDR4 ATX Motherboard picture

MSI PRO Z790-P WIFI DDR4 LGA 1700 Intel Z790 SATA 6Gb/s DDR4 ATX Motherboard

$163.49



ASUS PRIME Z490-V Motherboard Intel Z490 10th gen DDR4 LGA 1200 ATX w/ IO Shield picture

ASUS PRIME Z490-V Motherboard Intel Z490 10th gen DDR4 LGA 1200 ATX w/ IO Shield

$84.99