wok-next diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-softmodem-driver/stuff/slmodem.init	Tue Jun 16 21:41:05 2009 +0200
     1.3 @@ -0,0 +1,62 @@
     1.4 +#!/bin/sh
     1.5 +# /etc/init.d/slmodem: Start, stop and restart slmodemd deamon on SliTaz, at boot
     1.6 +# time or with the command line.
     1.7 +#
     1.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    1.10 +#
    1.11 +. /etc/init.d/rc.functions
    1.12 +. /etc/daemons.conf
    1.13 +
    1.14 +NAME=Smartlink modem
    1.15 +DESC="Smart Link Modem deamon"
    1.16 +DAEMON=/usr/sbin/slmodemd
    1.17 +OPTIONS=""
    1.18 +PIDFILE=/var/run/slmodemd.pid
    1.19 +
    1.20 +if [ `/sbin/lsmod | grep -c martian_dev}` -lt "1" ]; then
    1.21 +	echo "kernel module is not loaded!"
    1.22 +	exit 1
    1.23 +fi
    1.24 +
    1.25 +case "$1" in
    1.26 +  start)
    1.27 +    if [ -f $PIDFILE ] ; then
    1.28 +      echo "$NAME already running."
    1.29 +      exit 1
    1.30 +    fi
    1.31 +    echo -n "Starting $DESC: $NAME... "
    1.32 +    $DAEMON $OPTIONS
    1.33 +    status
    1.34 +	echo `/sbin/pidof $DAEMON` > $PIDFILE
    1.35 +    ;;
    1.36 +  stop)
    1.37 +    if [ ! -f $PIDFILE ] ; then
    1.38 +      echo "$NAME is not running."
    1.39 +      exit 1
    1.40 +    fi
    1.41 +    echo -n "Stopping $DESC: $NAME... "
    1.42 +    kill `cat $PIDFILE`
    1.43 +    status
    1.44 +    ;;
    1.45 +  restart)
    1.46 +    if [ ! -f $PIDFILE ] ; then
    1.47 +      echo "$NAME is not running."
    1.48 +      exit 1
    1.49 +    fi
    1.50 +    echo -n "Restarting $DESC: $NAME... "
    1.51 +    kill `cat $PIDFILE`
    1.52 +    sleep 2
    1.53 +    $DAEMON $OPTIONS
    1.54 +    status
    1.55 +	echo `/sbin/pidof $DAEMON` > $PIDFILE
    1.56 +    ;;
    1.57 +  *)
    1.58 +    echo ""
    1.59 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.60 +    echo ""
    1.61 +    exit 1
    1.62 +    ;;
    1.63 +esac
    1.64 +
    1.65 +exit 0