wok diff get-softmodem-driver/stuff/slmodem.init @ rev 22512
Up pkg-config (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jan 01 15:53:13 2020 +0100 (2020-01-01) |
parents | 4aed2b24febc |
children |
line diff
1.1 --- a/get-softmodem-driver/stuff/slmodem.init Thu Nov 08 09:35:38 2012 +0100 1.2 +++ b/get-softmodem-driver/stuff/slmodem.init Wed Jan 01 15:53:13 2020 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 #!/bin/sh 1.5 -# /etc/init.d/slmodem: Start, stop and restart slmodemd deamon on SliTaz, at boot 1.6 +# /etc/init.d/slmodem: Start, stop and restart slmodemd 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,7 +9,7 @@ 1.11 . /etc/daemons.conf 1.12 1.13 NAME="Smartlink modem" 1.14 -DESC="Smart Link Modem deamon" 1.15 +DESC="$(_ 'Smart Link Modem daemon')" 1.16 DAEMON=/usr/sbin/slmodemd 1.17 OPTIONS=$SLMODEM_OPTIONS 1.18 PIDFILE=/var/run/slmodemd.pid 1.19 @@ -17,37 +17,36 @@ 1.20 case "$1" in 1.21 start) 1.22 if active_pidfile $PIDFILE slmodemd ; then 1.23 - echo "$NAME already running." 1.24 + _ '%s is already running.' "$NAME" 1.25 exit 1 1.26 fi 1.27 - echo -n "Starting $DESC: $NAME... " 1.28 - $DAEMON $OPTIONS && echo `/bin/pidof $DAEMON` > $PIDFILE 1.29 + action 'Starting %s: %s...' "$DESC" "$NAME" 1.30 + $DAEMON $OPTIONS && echo $(/bin/pidof $DAEMON) > $PIDFILE 1.31 status 1.32 ;; 1.33 stop) 1.34 if ! active_pidfile $PIDFILE slmodemd ; then 1.35 - echo "$NAME is not running." 1.36 + _ '%s is not running.' "$NAME" 1.37 exit 1 1.38 fi 1.39 - echo -n "Stopping $DESC: $NAME... " 1.40 - kill `cat $PIDFILE` 1.41 + action 'Stopping %s: %s...' "$DESC" "$NAME" 1.42 + kill $(cat $PIDFILE) 1.43 status 1.44 ;; 1.45 restart) 1.46 if ! active_pidfile $PIDFILE slmodemd ; then 1.47 - echo "$NAME is not running." 1.48 + _ '%s is not running.' "$NAME" 1.49 exit 1 1.50 fi 1.51 - echo -n "Restarting $DESC: $NAME... " 1.52 - kill `cat $PIDFILE` 1.53 + action 'Restarting %s: %s...' "$DESC" "$NAME" 1.54 + kill $(cat $PIDFILE) 1.55 sleep 2 1.56 - $DAEMON $OPTIONS && echo `/bin/pidof $DAEMON` > $PIDFILE 1.57 + $DAEMON $OPTIONS && echo $(/bin/pidof $DAEMON) > $PIDFILE 1.58 status 1.59 ;; 1.60 *) 1.61 - echo "" 1.62 - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.63 - echo "" 1.64 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.65 + newline 1.66 exit 1 1.67 ;; 1.68 esac