On Monday 05 January 2004 03:44 am, Darryl Adams wrote: > I have a non standard Wireless Network Card which used to start > automatically in Mandrake 9.1 but not in 9.2. I have also use Capture to > mount my 3 ntfs partitions , again which I have mount manually. > > Is there any way of doing a really simple script during bootup to mount > my drives and to set up the ra0 routing? My scripting skills are rusty > verging on non excistant, however, I can create the script to do the 4 > actions required. I just need to know where to put it so that the bootup > script can pick it up.
Darryl, the easiest way to do this is to pick up an already existent script in the /etc/init.d directory and copy it, modify it for your needs and then use either webmin or run sysconfig against the script to add it into the levels. Pay special attention to the chkconfig line, it specifies the init levels for the script, run order and nice level, respectively. Thus, this script runs on init 2, 3,4,5 and it runs at order # 65 from 0-99 (thus later after network and other daemons have started) and has a nice level of 35. The functions line allows you access to special functions like killproc to kill the process, rather than having to killall or track the pid. A quick example: #!/bin/sh # # ddclient This shell script takes care of starting and stopping # ddclient. # # chkconfig: 2345 65 35 # description: ddclient provides support for updating dynamic DNS services. [ -f /etc/ddclient.conf ] || exit 0 . /etc/rc.d/init.d/functions # See how we were called. case "$1" in start) # Start daemons. echo -n "Starting ddclient: " touch /var/lock/subsys/ddclient daemon ddclient -daemon 300 echo ;; stop) # Stop daemons. echo -n "Shutting down ddclient: " killproc ddclient echo rm -f /var/lock/subsys/ddclient ;; restart) $0 stop $0 start ;; status) status ddclient ;; *) echo "Usage: ddclient {start|stop|restart|status}" exit 1 esac exit 0 -- Bryan Phinney Software Test Engineer
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com