wok-current diff get-softmodem-driver/stuff/martian.init @ rev 16632

wiringpi: typo in tarball
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 12 06:41:14 2014 +0000 (2014-05-12)
parents
children ff5fd8788cd9
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-softmodem-driver/stuff/martian.init	Mon May 12 06:41:14 2014 +0000
     1.3 @@ -0,0 +1,62 @@
     1.4 +#!/bin/sh
     1.5 +# /etc/init.d/martian: Start, stop and restart martian 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="Martian modem"
    1.15 +DESC="Agere Systems PCI Modem deamon"
    1.16 +DAEMON=/usr/sbin/martian_modem
    1.17 +OPTIONS="--daemon $MARTIAN_OPTIONS"
    1.18 +PIDFILE=/var/run/martian.pid
    1.19 +MODULE="martian_dev"
    1.20 +
    1.21 +if [ `/sbin/lsmod | grep -c ${MODULE}` -lt "1" ]; then
    1.22 +	echo "kernel module is not loaded!"
    1.23 +	exit 1
    1.24 +fi
    1.25 +
    1.26 +case "$1" in
    1.27 +  start)
    1.28 +    if active_pidfile $PIDFILE martian_modem ; then
    1.29 +      echo "$NAME already running."
    1.30 +      exit 1
    1.31 +    fi
    1.32 +    echo -n "Starting $DESC: $NAME... "
    1.33 +    $DAEMON $OPTIONS &&  echo `/bin/pidof $DAEMON` > $PIDFILE
    1.34 +    status
    1.35 +    ;;
    1.36 +  stop)
    1.37 +    if ! active_pidfile $PIDFILE martian_modem ; then
    1.38 +      echo "$NAME is not running."
    1.39 +      exit 1
    1.40 +    fi
    1.41 +    echo -n "Stopping $DESC: $NAME... "
    1.42 +    killall martian_modem
    1.43 +	rm $PIDFILE
    1.44 +    status
    1.45 +    ;;
    1.46 +  restart)
    1.47 +    if ! active_pidfile $PIDFILE martian_modem ; then
    1.48 +      echo "$NAME is not running."
    1.49 +      exit 1
    1.50 +    fi
    1.51 +    echo -n "Restarting $DESC: $NAME... "
    1.52 +    killall martian_modem
    1.53 +    sleep 2
    1.54 +    $DAEMON $OPTIONS &&  echo `/bin/pidof $DAEMON` > $PIDFILE
    1.55 +    status
    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