wok diff dhid/stuff/init.d/dhid @ rev 21784
Update powermanga (thanks Rene Rivero)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jul 21 10:32:10 2019 +0200 (2019-07-21) |
parents | 429355d87af5 |
children |
line diff
1.1 --- a/dhid/stuff/init.d/dhid Thu Apr 24 14:08:25 2014 +0200 1.2 +++ b/dhid/stuff/init.d/dhid Sun Jul 21 10:32:10 2019 +0200 1.3 @@ -2,47 +2,52 @@ 1.4 # 1.5 # /etc/init.d/dhid: Start, stop and restart dhis daemon on SliTaz 1.6 # 1.7 -. /lib/libtaz.sh 1.8 +. /etc/init.d/rc.functions 1.9 #. /etc/daemons.conf 1.10 1.11 NAME=DHID 1.12 -DESC="dyn ip" 1.13 +DESC="$(_ 'DHIS client daemon')" 1.14 DAEMON=/usr/sbin/dhid 1.15 PIDFILE=/run/dhid.pid 1.16 OPTIONS="-P $PIDFILE" 1.17 1.18 case "$1" in 1.19 - start) 1.20 + start) 1.21 if active_pidfile $PIDFILE dhid; then 1.22 - echo "$NAME already running."; §exit 1 1.23 + _ '%s is already running.' $NAME 1.24 + exit 1 1.25 fi 1.26 - echo -n "Starting $DESC: $NAME... " 1.27 - $DAEMON $OPTIONS 1.28 - status ;; 1.29 - 1.30 + action 'Starting %s: %s...' "$DESC" $NAME 1.31 + $DAEMON $OPTIONS 1.32 + status 1.33 + ;; 1.34 stop) 1.35 if ! active_pidfile $PIDFILE dhid; then 1.36 - echo "$NAME is not running."; exit 1 1.37 + _ '%s is not running.' $NAME 1.38 + exit 1 1.39 fi 1.40 - echo -n "Stopping $DESC: $NAME... " 1.41 + action 'Stopping %s: %s...' "$DESC" $NAME 1.42 kill $(cat $PIDFILE) 1.43 rm $PIDFILE 1.44 - status ;; 1.45 - 1.46 + status 1.47 + ;; 1.48 restart) 1.49 if ! active_pidfile $PIDFILE dhid; then 1.50 - echo "$NAME is not running."; exit 1 1.51 + _ '%s is not running.' $NAME 1.52 + exit 1 1.53 fi 1.54 - echo -n "Restarting $DESC: $NAME... " 1.55 + action 'Restarting %s: %s...' "$DESC" $NAME 1.56 kill $(cat $PIDFILE) 1.57 rm $PIDFILE 1.58 sleep 2 1.59 $DAEMON $OPTIONS 1.60 - status ;; 1.61 - 1.62 - *) 1.63 - echo "Usage: /etc/init.d/$(basename $0) [start|stop|restart]" 1.64 - exit 1 ;; 1.65 + status 1.66 + ;; 1.67 + *) 1.68 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.69 + newline 1.70 + exit 1 1.71 + ;; 1.72 esac 1.73 1.74 exit 0