Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am totally lost when it comes to writing automated scripts in linux !
I need to excute a set of commands everytime that my linux router box boots up. So can anyone help me by giving some examples of how to mount the floppy drive ( there is an entry in the /etc/fstab ) and run a set of commands from the floppy drive to excute a software which is in the floppy drive.
hello!
Well I know very little about writing scripts but I found some useful information here: http://www.atnf.csiro.au/people/rgoo.../boot-scripts/
it basically talks about implementation run-levels and what to modify.
I hope it is of some use to you,
good luck
You'll have to create a script. Place it in /etc/rc.d or /etc/init.d and make it executable. The script code would look something like what is typed below. Since you didn't specify what is being run on the floppy, I just called them command1, command2, and anothercommand. Whatever executable you wish to run, make sure that the ./ is in front of it, or use the full path like the last command.
#!/bin/bash
# Mount the floppy
mount -t vfat /dev/fd0 /mnt/floppy
# Change to floppy and run commands
cd /mnt/floppy
./command1.script
./command2.script
/mnt/floppy/anothercommand.script
Last edited by musicman_ace; 02-26-2005 at 12:25 AM.
I read that the /etc/rc.d is like the "orchestator" and it is for such saying the main script, it runs all other scripts, is this correct or did I missunderstood??
also I have another question:
what does it mean to make it executable??
Thanks and im sorry if im being annoying but I am really new to this and very anxious to learn
Originally posted by purefan I read that the /etc/rc.d is like the "orchestator" and it is for such saying the main script
I would agree with that statement. The scripts are what get executed when a runlevel is changed, meaning if you shutdown, reboot, boot up, or change to a different runlevel for maintainance or something.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.