wok annotate get-softmodem-driver/stuff/martian.init @ rev 20080

revert hexchat: does not work with 2.12.4 version like that
author Erkan Yilmaz <erkan@slitaz.org>
date Wed Sep 27 17:35:06 2017 +0000 (2017-09-27)
parents 4aed2b24febc
children
rev   line source
pascal@13591 1 #!/bin/sh
al@19161 2 # /etc/init.d/martian: Start, stop and restart martian daemon on SliTaz, at boot
pascal@13591 3 # time or with the command line.
pascal@13591 4 #
pascal@13591 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
pascal@13591 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
pascal@13591 7 #
pascal@13591 8 . /etc/init.d/rc.functions
pascal@13591 9 . /etc/daemons.conf
pascal@13591 10
pascal@13591 11 NAME="Martian modem"
al@19161 12 DESC="$(_ 'Agere Systems PCI Modem daemon')"
pascal@13591 13 DAEMON=/usr/sbin/martian_modem
pascal@13591 14 OPTIONS="--daemon $MARTIAN_OPTIONS"
pascal@13591 15 PIDFILE=/var/run/martian.pid
pascal@13591 16 MODULE="martian_dev"
pascal@13591 17
al@19161 18 if [ $(/sbin/lsmod | grep -c ${MODULE}) -lt 1 ]; then
al@19161 19 _ 'kernel module is not loaded!'
pascal@13591 20 exit 1
pascal@13591 21 fi
pascal@13591 22
pascal@13591 23 case "$1" in
pascal@13591 24 start)
pascal@13591 25 if active_pidfile $PIDFILE martian_modem ; then
al@19161 26 _ '%s is already running.' "$NAME"
pascal@13591 27 exit 1
pascal@13591 28 fi
al@19161 29 action 'Starting %s: %s...' "$DESC" "$NAME"
al@19161 30 $DAEMON $OPTIONS && echo $(/bin/pidof $DAEMON) > $PIDFILE
pascal@13591 31 status
pascal@13591 32 ;;
pascal@13591 33 stop)
pascal@13591 34 if ! active_pidfile $PIDFILE martian_modem ; then
al@19161 35 _ '%s is not running.' "$NAME"
pascal@13591 36 exit 1
pascal@13591 37 fi
al@19161 38 action 'Stopping %s: %s...' "$DESC" "$NAME"
pascal@13591 39 killall martian_modem
al@19161 40 rm $PIDFILE
pascal@13591 41 status
pascal@13591 42 ;;
pascal@13591 43 restart)
pascal@13591 44 if ! active_pidfile $PIDFILE martian_modem ; then
al@19161 45 _ '%s is not running.' "$NAME"
pascal@13591 46 exit 1
pascal@13591 47 fi
al@19161 48 action 'Restarting %s: %s...' "$DESC" "$NAME"
pascal@13591 49 killall martian_modem
pascal@13591 50 sleep 2
al@19161 51 $DAEMON $OPTIONS && echo $(/bin/pidof $DAEMON) > $PIDFILE
pascal@13591 52 status
pascal@13591 53 ;;
pascal@13591 54 *)
al@19161 55 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
al@19161 56 newline
pascal@13591 57 exit 1
pascal@13591 58 ;;
pascal@13591 59 esac
pascal@13591 60
pascal@13591 61 exit 0