wok-6.x annotate get-softmodem-driver/stuff/slmodem.init @ rev 7897
Up: module-init-tools 1.12
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Sun Jan 09 14:07:48 2011 +0100 (2011-01-09) |
parents | e5ab27ad8b9e |
children | e26a09e68fcb |
rev | line source |
---|---|
domcox@3473 | 1 #!/bin/sh |
domcox@3473 | 2 # /etc/init.d/slmodem: Start, stop and restart slmodemd deamon on SliTaz, at boot |
domcox@3473 | 3 # time or with the command line. |
domcox@3473 | 4 # |
domcox@3473 | 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
domcox@3473 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
domcox@3473 | 7 # |
domcox@3473 | 8 . /etc/init.d/rc.functions |
domcox@3473 | 9 . /etc/daemons.conf |
domcox@3473 | 10 |
domcox@3479 | 11 NAME="Smartlink modem" |
domcox@3473 | 12 DESC="Smart Link Modem deamon" |
domcox@3473 | 13 DAEMON=/usr/sbin/slmodemd |
domcox@3478 | 14 OPTIONS=$SLMODEM_OPTIONS |
domcox@3473 | 15 PIDFILE=/var/run/slmodemd.pid |
domcox@3473 | 16 |
domcox@3473 | 17 case "$1" in |
domcox@3473 | 18 start) |
domcox@3473 | 19 if [ -f $PIDFILE ] ; then |
domcox@3473 | 20 echo "$NAME already running." |
domcox@3473 | 21 exit 1 |
domcox@3473 | 22 fi |
domcox@3473 | 23 echo -n "Starting $DESC: $NAME... " |
domcox@3479 | 24 $DAEMON $OPTIONS && echo `/bin/pidof $DAEMON` > $PIDFILE |
domcox@3473 | 25 status |
domcox@3473 | 26 ;; |
domcox@3473 | 27 stop) |
domcox@3473 | 28 if [ ! -f $PIDFILE ] ; then |
domcox@3473 | 29 echo "$NAME is not running." |
domcox@3473 | 30 exit 1 |
domcox@3473 | 31 fi |
domcox@3473 | 32 echo -n "Stopping $DESC: $NAME... " |
domcox@3473 | 33 kill `cat $PIDFILE` |
domcox@3473 | 34 status |
domcox@3473 | 35 ;; |
domcox@3473 | 36 restart) |
domcox@3473 | 37 if [ ! -f $PIDFILE ] ; then |
domcox@3473 | 38 echo "$NAME is not running." |
domcox@3473 | 39 exit 1 |
domcox@3473 | 40 fi |
domcox@3473 | 41 echo -n "Restarting $DESC: $NAME... " |
domcox@3473 | 42 kill `cat $PIDFILE` |
domcox@3473 | 43 sleep 2 |
domcox@3479 | 44 $DAEMON $OPTIONS && echo `/bin/pidof $DAEMON` > $PIDFILE |
domcox@3473 | 45 status |
domcox@3473 | 46 ;; |
domcox@3473 | 47 *) |
domcox@3473 | 48 echo "" |
domcox@3473 | 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
domcox@3473 | 50 echo "" |
domcox@3473 | 51 exit 1 |
domcox@3473 | 52 ;; |
domcox@3473 | 53 esac |
domcox@3473 | 54 |
domcox@3473 | 55 exit 0 |