See below for a script I use on SuSE 7.1, kernel 2.4.19 that I cobbled together from the skeleton script and the Speedtouch documentation. On Monday 06 January 2003 05:27 am, Oliver Maunder wrote: [snip-snip]
So, what I need is a script that starts pppd on startup, and stops it (and rchotplug) when I shut down. What would I need to put in these scripts, and where should they go?
[snip-snip] *****************start script***************************** #!/bin/sh #script for loading benoit drivers ### BEGIN INIT INFO # Provides: pppd call adsl # Required-Start: inetd # Required-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: ### END INIT INFO # Source SuSE config . /etc/rc.config # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} case "$1" in start) echo -n "Starting pppd_adsl" ## Start daemon with startproc(8). If this fails ## the echo return value is set appropriate. # startproc should return 0, even if service is # already running to match LSB spec. startproc /usr/sbin/pppd call adsl # Remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down pppd_adsl" ## Stop daemon with killproc(8) and if this fails ## set echo the echo return value. killproc -TERM pppd # Remember status and be verbose rc_status -v ;; status) echo -n "Checking for pppd_adsl: " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. # Status has a slightly different for the status command: # 0 - service running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running # If checkproc would return LSB compliant ret values, # things could be a little bit easier here. This will # probably soon be the case ... checkproc pppd; rc=$? if test $rc = 0; then echo "OK" else echo "No process" if test -e /var/run/pppd.pid; then exit 1 else exit 3 fi fi #rc_status ;; *) echo "Usage: $0 {start|stop|status}" exit 1 ;; esac rc_exit ************************end script********************** I do not profess to be a whiz bash scripter and others may surely provide more artfully coded work, but it works. This file is located in /etc/init.d on my system. I ran insserv to add it to the appropriate rc level (see above in script). You will most likely need to adjust this to your system, but I hope this gives you some ideas. No guarantee, use at your own risk! I actually start the modem and login during boot and then reverse the process on a shutdown. Shutting down pppd seems to be all I need to do to prevent a freeze. -- ThankYouKindly! Willard E. [Bill] Fullam III wfullam@bellsouth.net http://home.bellsouth.net/p/PWP-fullamgroup