wok view get-softmodem-driver/stuff/slmodem.init @ rev 3473

get-softmodem-driver: Add support for Smart Link modem
author Dominique Corbex <domcox@users.sourceforge.net>
date Tue Jun 16 21:41:05 2009 +0200 (2009-06-16)
parents
children e5ab27ad8b9e
line source
1 #!/bin/sh
2 # /etc/init.d/slmodem: Start, stop and restart slmodemd deamon on SliTaz, at boot
3 # time or with the command line.
4 #
5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=Smartlink modem
12 DESC="Smart Link Modem deamon"
13 DAEMON=/usr/sbin/slmodemd
14 OPTIONS=""
15 PIDFILE=/var/run/slmodemd.pid
17 if [ `/sbin/lsmod | grep -c martian_dev}` -lt "1" ]; then
18 echo "kernel module is not loaded!"
19 exit 1
20 fi
22 case "$1" in
23 start)
24 if [ -f $PIDFILE ] ; then
25 echo "$NAME already running."
26 exit 1
27 fi
28 echo -n "Starting $DESC: $NAME... "
29 $DAEMON $OPTIONS
30 status
31 echo `/sbin/pidof $DAEMON` > $PIDFILE
32 ;;
33 stop)
34 if [ ! -f $PIDFILE ] ; then
35 echo "$NAME is not running."
36 exit 1
37 fi
38 echo -n "Stopping $DESC: $NAME... "
39 kill `cat $PIDFILE`
40 status
41 ;;
42 restart)
43 if [ ! -f $PIDFILE ] ; then
44 echo "$NAME is not running."
45 exit 1
46 fi
47 echo -n "Restarting $DESC: $NAME... "
48 kill `cat $PIDFILE`
49 sleep 2
50 $DAEMON $OPTIONS
51 status
52 echo `/sbin/pidof $DAEMON` > $PIDFILE
53 ;;
54 *)
55 echo ""
56 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
57 echo ""
58 exit 1
59 ;;
60 esac
62 exit 0