wok-current diff boxbackup-client/stuff/bbackupd @ 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 | e99b372b0465 |
children | ff5fd8788cd9 |
line diff
1.1 --- a/boxbackup-client/stuff/bbackupd Sat Feb 18 17:25:41 2012 +0100 1.2 +++ b/boxbackup-client/stuff/bbackupd Thu May 26 20:16:45 2016 +0300 1.3 @@ -9,7 +9,7 @@ 1.4 . /etc/daemons.conf 1.5 1.6 NAME=BBackupd 1.7 -DESC="BoxBackup deamon" 1.8 +DESC="$(_ '%s daemon' BoxBackup)" 1.9 DAEMON=/usr/bin/bbackupd 1.10 OPTIONS=$BBSTORED_OPTIONS 1.11 PIDFILE=/var/run/bbackupd.pid 1.12 @@ -17,39 +17,38 @@ 1.13 case "$1" in 1.14 start) 1.15 if active_pidfile $PIDFILE bbackupd ; 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 - $DAEMON $OPTIONS > /dev/null 1.22 + action 'Starting %s: %s...' "$DESC" $NAME 1.23 + $DAEMON $OPTIONS >/dev/null 1.24 status 1.25 ;; 1.26 stop) 1.27 if ! active_pidfile $PIDFILE bbackupd ; 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 - kill `cat $PIDFILE` 1.34 - rm -f $PIDFILE 1.35 + action 'Stopping %s: %s...' "$DESC" $NAME 1.36 + kill $(cat $PIDFILE) 1.37 + rm -f $PIDFILE 1.38 status 1.39 ;; 1.40 restart) 1.41 if ! active_pidfile $PIDFILE bbackupd ; then 1.42 - echo "$NAME is not running." 1.43 + _ '%s is not running.' $NAME 1.44 exit 1 1.45 fi 1.46 - echo -n "Restarting $DESC: $NAME... " 1.47 - kill `cat $PIDFILE` 1.48 - rm -f $PIDFILE 1.49 + action 'Restarting %s: %s...' "$DESC" $NAME 1.50 + kill $(cat $PIDFILE) 1.51 + rm -f $PIDFILE 1.52 sleep 2 1.53 - $DAEMON $OPTIONS > /dev/null 1.54 + $DAEMON $OPTIONS >/dev/null 1.55 status 1.56 ;; 1.57 *) 1.58 - echo "" 1.59 - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.60 - echo "" 1.61 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.62 + newline 1.63 exit 1 1.64 ;; 1.65 esac