wok diff ofono/stuff/etc/init.d/ofono @ rev 19159
/etc/init.d/*: use 'action' in pair with 'status'.
'action' returns translated message, so why not to add full translatable /etc/init.d/* content
'action' returns translated message, so why not to add full translatable /etc/init.d/* content
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu May 26 20:16:45 2016 +0300 (2016-05-26) |
parents | 8ebec64e4191 |
children |
line diff
1.1 --- a/ofono/stuff/etc/init.d/ofono Fri Nov 29 11:43:20 2013 +0000 1.2 +++ b/ofono/stuff/etc/init.d/ofono Thu May 26 20:16:45 2016 +0300 1.3 @@ -10,7 +10,7 @@ 1.4 . /etc/daemons.conf 1.5 1.6 NAME=Ofono 1.7 -DESC="Mobile telephony Manager" 1.8 +DESC="$(_ 'Mobile telephony Manager')" 1.9 DAEMON=/usr/sbin/ofonod 1.10 OPTIONS=$OFONO_OPTIONS 1.11 PIDFILE=/var/run/ofono.pid 1.12 @@ -18,30 +18,30 @@ 1.13 case "$1" in 1.14 start) 1.15 if active_pidfile $PIDFILE ofonod ; then 1.16 - echo "$NAME already running." 1.17 + _ '%s is already running.' $NAME 1.18 exit 1 1.19 fi 1.20 - echo -n "Starting $DESC: $NAME... " 1.21 + action 'Starting %s: %s...' "$DESC" $NAME 1.22 $DAEMON $OPTIONS 1.23 status 1.24 pidof ofonod > $PIDFILE 1.25 ;; 1.26 stop) 1.27 if ! active_pidfile $PIDFILE ofonod ; then 1.28 - echo "$NAME is not running." 1.29 + _ '%s is not running.' $NAME 1.30 exit 1 1.31 fi 1.32 - echo -n "Stopping $DESC: $NAME... " 1.33 + action 'Stopping %s: %s...' "$DESC" $NAME 1.34 rm -rf $PIDFILE 1.35 kill $(pidof ofonod) 1.36 status 1.37 ;; 1.38 restart) 1.39 if ! active_pidfile $PIDFILE ofonod ; then 1.40 - echo "$NAME is not running." 1.41 + _ '%s is not running.' $NAME 1.42 exit 1 1.43 fi 1.44 - echo -n "Restarting $DESC: $NAME... " 1.45 + action 'Restarting %s: %s...' "$DESC" $NAME 1.46 rm -rf $PIDFILE 1.47 kill $(pidof ofonod) && 1.48 sleep 2 && 1.49 @@ -49,9 +49,8 @@ 1.50 status 1.51 ;; 1.52 *) 1.53 - printf "\n\033[1mUsage:\033[0m /etc/init.d/%b [start|stop|restart]\n" \ 1.54 - "$(basename $0)" 1.55 - exit 1 1.56 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.57 + newline 1.58 ;; 1.59 esac 1.60