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
  •  


Crucial MX500 500GB 2.5

Crucial MX500 500GB 2.5" SATA III Internal SSD CT500MX500SSD1

$53.99



SSD 880EVO SATA III 2.5 4TB INTERNAL STATE DRIVE picture

SSD 880EVO SATA III 2.5 4TB INTERNAL STATE DRIVE

$214.99



Samsung 860 EVO 250GB SSD MZ-76E250 2.5

Samsung 860 EVO 250GB SSD MZ-76E250 2.5" SATA III Solid State Drive

$39.99



Ediloca 128GB SATA III SSD 2.5 Inch Internal Drive for PC & Laptop picture

Ediloca 128GB SATA III SSD 2.5 Inch Internal Drive for PC & Laptop

$73.99



Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot picture

Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot

$549.00



SAMSUNG SSD 512GB 500GB 480GB 256GB 250GB 240GB SSD 2.5 Solide State Drive 6Gbps picture

SAMSUNG SSD 512GB 500GB 480GB 256GB 250GB 240GB SSD 2.5 Solide State Drive 6Gbps

$37.99



Fanxiang 1/2/5/10Pcs 2.5'' SATA SSD Lot 1TB 2TB 4TB 512GB 256GB TLC Internal SSD picture

Fanxiang 1/2/5/10Pcs 2.5'' SATA SSD Lot 1TB 2TB 4TB 512GB 256GB TLC Internal SSD

$129.99



2 PACK 128 GB SSD M.2 2280 SATA Solid State Drive Major Brands, Samsung, LiteON picture

2 PACK 128 GB SSD M.2 2280 SATA Solid State Drive Major Brands, Samsung, LiteON

$28.80



Micron MTFDDAK256TBN 256 GB, Internal ,2.5

Micron MTFDDAK256TBN 256 GB, Internal ,2.5" SSD

$23.00



Netac 120GB 256GB 1TB 2TB Internal SSD 2.5'' SATAIII 6Gb/s Solid State Drive lot picture

Netac 120GB 256GB 1TB 2TB Internal SSD 2.5'' SATAIII 6Gb/s Solid State Drive lot

$119.99