Results 1 to 3 of 3

Thread: I need to include a script in the startup!

Hybrid View

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Location
    Baton Rouge, Louisiana
    Posts
    9

    I need to include a script in the startup!

    For reasons mentioned in another topic:
    http://knoppix.net/forum/viewtopic.p...886de5994fd572

    I need to write a shell script. The script needs to simply perform the following command:

    sudo ifdown eth0 && sudo ifup eth0

    Can someone help me? I need to know how to write this script and where to place it to have it automatically run when the KNOPPIX OS is loaded on a remastered CD. I'm new to Linux, but it looks like I can create a new text file, name it SudoTest.sh and simply put the above text followed by 'exit' and it will work. So if I'm correct, all I need to know is where I need to place this SudoTest.sh file in order to have it auto-run at bootup. If I'm reading the remastering instructions properly, this script needs to be placed in the /mnt/hda5/knx/source/KNOPPIX/etc/rc5.d directory. Can someone confirm? Is it really that simple?

    Thank you,

    Brandon

  2. #2
    Junior Member
    Join Date
    Sep 2007
    Location
    Baton Rouge, Louisiana
    Posts
    9
    I ended up simply adding the sudo commands to the knoppix.sh script to resolve my issue.

    However, if anyone knows where/how to insert a new shell script during remastering, I am still curious to know!

    Thank you,

    Brandon

  3. #3
    Junior Member registered user
    Join Date
    Jun 2007
    Posts
    16
    you were on the right track, but didn't quite understand how the rc?.d directories work - they are an old unix way of doing startup.
    Knoppix is mostly setup by the knoppix-autoconfig, and not much is needed in the other runlevels like 5.

    What you would want to do is place your SudoTest.sh script in /etc/init.d, then create a symlink in /etc/rc5.d of the form:
    S##SudoTest where the ## is replaced by a two digit number that represents when in the startup sequence the script should run.
    Make sure your script is executable ( chmod +x /etc/init.d/SudoTest.sh ),

    There isn't much there on a stock knoppix as far as I recall (I'm working from a heavily changed version now, and don't have the original handy),
    so you could safely use S50SudoTest. If there are other scripts, just make sure yours happens after the network is brought up the first time...

    (prepend your source tree to the dirs above if not working in the chroot environment - /mnt/hda5/knx/source/KNOPPIX/ it looks like ...)

Similar Threads

  1. how do I run a script on startup
    By monkeyking in forum MS Windows & New to Linux
    Replies: 1
    Last Post: 01-03-2005, 10:19 PM
  2. Help with shell script + startup
    By niXnoob in forum General Support
    Replies: 3
    Last Post: 10-06-2004, 04:56 AM
  3. Need help with startup script.
    By obsoleto in forum General Support
    Replies: 1
    Last Post: 06-02-2004, 05:43 AM
  4. Startup script and noscsi
    By darthczyz in forum Customising & Remastering
    Replies: 2
    Last Post: 04-14-2004, 06:06 PM
  5. Startup Script doesn't run
    By orcslayer in forum General Support
    Replies: 1
    Last Post: 01-03-2004, 02:04 AM

Posting Permissions

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


Kingston 32GB 64GB 128GB 256GB USB 3.0 Flash Drive Thumb Memory Stick Pen lot picture

Kingston 32GB 64GB 128GB 256GB USB 3.0 Flash Drive Thumb Memory Stick Pen lot

$285.90



2024 Full Version Office Professional Plus for 1 PC Flash USB Drive picture

2024 Full Version Office Professional Plus for 1 PC Flash USB Drive

$89.99



Microsoft Windows 11 Pro 64bit - New Sealed – Flash USB 1 PC picture

Microsoft Windows 11 Pro 64bit - New Sealed – Flash USB 1 PC

$49.99



2021 Full Version Office Professional Plus for 1 PC Flash USB Drive picture

2021 Full Version Office Professional Plus for 1 PC Flash USB Drive

$59.99



USB 3.0 Flash Drive 32GB 64GB 128GB Memory Stick Thumb Stick Lot Pack picture

USB 3.0 Flash Drive 32GB 64GB 128GB Memory Stick Thumb Stick Lot Pack

$826.09



USB Type-A Flash Drive Metal Memory Stick High Speed USB Drive 128GB 256GB 512GB picture

USB Type-A Flash Drive Metal Memory Stick High Speed USB Drive 128GB 256GB 512GB

$8.47



LOT 10x SanDisk 32GB ULTRA USB 3.0 flash drive SDCZ48-032G 32 GB read 100 MB/s picture

LOT 10x SanDisk 32GB ULTRA USB 3.0 flash drive SDCZ48-032G 32 GB read 100 MB/s

$39.80



Wholesale 5/10/100PCS 1GB 2GB 4GB 8GB 16GB 32GB USB 2.0 Flash Drive Memory Stick picture

Wholesale 5/10/100PCS 1GB 2GB 4GB 8GB 16GB 32GB USB 2.0 Flash Drive Memory Stick

$218.79



128GB USB 14-in-1 MacOS bootable Installer repair recovery tech support service picture

128GB USB 14-in-1 MacOS bootable Installer repair recovery tech support service

$39.99



Microsoft Windows 10 Pro 64 Bit USB Flash Drive picture

Microsoft Windows 10 Pro 64 Bit USB Flash Drive

$24.99