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
  •  


Vintage NeXT Computer Drive Accessories Kit COMPLETE-SCSI Cable-Screws-3M Strap picture

Vintage NeXT Computer Drive Accessories Kit COMPLETE-SCSI Cable-Screws-3M Strap

$149.99



RARE VTG NEC IBM PC COMMAND SET SPIN MATE 6150 + SPINWRITER 8850 USER GUIDE picture

RARE VTG NEC IBM PC COMMAND SET SPIN MATE 6150 + SPINWRITER 8850 USER GUIDE

$199.95



Vintage 2002 AutoCAD Set - With Serial and Code picture

Vintage 2002 AutoCAD Set - With Serial and Code

$44.55



Commodore 128 Vintage Computer Not Working No Power Damage READ picture

Commodore 128 Vintage Computer Not Working No Power Damage READ

$129.00



IBM Model M Terminal Vintage Clicky 122-Key 1984 W/ blue keys, and unique keys picture

IBM Model M Terminal Vintage Clicky 122-Key 1984 W/ blue keys, and unique keys

$199.99



Original Vintage Old Style STANDARD Black CD Jewel Case (Heavy Duty) 90g Lot picture

Original Vintage Old Style STANDARD Black CD Jewel Case (Heavy Duty) 90g Lot

$316.95



Vintage Apple M4848 USB Mouse GRAPHITE iMac G3 Hockey Puck Mouse 1998 picture

Vintage Apple M4848 USB Mouse GRAPHITE iMac G3 Hockey Puck Mouse 1998

$23.99



IBM PCjr Vintage Desktop Computer 128KB w/ Diskette Drive & Keyboard picture

IBM PCjr Vintage Desktop Computer 128KB w/ Diskette Drive & Keyboard

$699.00



Vintage HP-85A Series 80 Computer Hewlett Packard Working Powers On + Case RAM picture

Vintage HP-85A Series 80 Computer Hewlett Packard Working Powers On + Case RAM

$275.00



Vintage Key Tronic LT DESIGNER Mechanical/Rubber Dome Keyboard DIN-5 AT/XT picture

Vintage Key Tronic LT DESIGNER Mechanical/Rubber Dome Keyboard DIN-5 AT/XT

$50.00