wok diff get-softmodem-driver/stuff/martian.init @ rev 20617
Update granite
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Dec 25 17:06:17 2018 +0100 (2018-12-25) |
parents | 4aed2b24febc |
children |
line diff
1.1 --- a/get-softmodem-driver/stuff/martian.init Thu Nov 08 09:35:38 2012 +0100 1.2 +++ b/get-softmodem-driver/stuff/martian.init Tue Dec 25 17:06:17 2018 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 #!/bin/sh 1.5 -# /etc/init.d/martian: Start, stop and restart martian deamon on SliTaz, at boot 1.6 +# /etc/init.d/martian: Start, stop and restart martian daemon on SliTaz, at boot 1.7 # time or with the command line. 1.8 # 1.9 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS 1.10 @@ -9,52 +9,51 @@ 1.11 . /etc/daemons.conf 1.12 1.13 NAME="Martian modem" 1.14 -DESC="Agere Systems PCI Modem deamon" 1.15 +DESC="$(_ 'Agere Systems PCI Modem daemon')" 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 +if [ $(/sbin/lsmod | grep -c ${MODULE}) -lt 1 ]; then 1.24 + _ 'kernel module is not loaded!' 1.25 exit 1 1.26 fi 1.27 1.28 case "$1" in 1.29 start) 1.30 if active_pidfile $PIDFILE martian_modem ; then 1.31 - echo "$NAME already running." 1.32 + _ '%s is already running.' "$NAME" 1.33 exit 1 1.34 fi 1.35 - echo -n "Starting $DESC: $NAME... " 1.36 - $DAEMON $OPTIONS && echo `/bin/pidof $DAEMON` > $PIDFILE 1.37 + action 'Starting %s: %s...' "$DESC" "$NAME" 1.38 + $DAEMON $OPTIONS && echo $(/bin/pidof $DAEMON) > $PIDFILE 1.39 status 1.40 ;; 1.41 stop) 1.42 if ! active_pidfile $PIDFILE martian_modem ; then 1.43 - echo "$NAME is not running." 1.44 + _ '%s is not running.' "$NAME" 1.45 exit 1 1.46 fi 1.47 - echo -n "Stopping $DESC: $NAME... " 1.48 + action 'Stopping %s: %s...' "$DESC" "$NAME" 1.49 killall martian_modem 1.50 - rm $PIDFILE 1.51 + rm $PIDFILE 1.52 status 1.53 ;; 1.54 restart) 1.55 if ! active_pidfile $PIDFILE martian_modem ; then 1.56 - echo "$NAME is not running." 1.57 + _ '%s is not running.' "$NAME" 1.58 exit 1 1.59 fi 1.60 - echo -n "Restarting $DESC: $NAME... " 1.61 + action 'Restarting %s: %s...' "$DESC" "$NAME" 1.62 killall martian_modem 1.63 sleep 2 1.64 - $DAEMON $OPTIONS && echo `/bin/pidof $DAEMON` > $PIDFILE 1.65 + $DAEMON $OPTIONS && echo $(/bin/pidof $DAEMON) > $PIDFILE 1.66 status 1.67 ;; 1.68 *) 1.69 - echo "" 1.70 - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.71 - echo "" 1.72 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.73 + newline 1.74 exit 1 1.75 ;; 1.76 esac