wok-next diff nfs-utils/stuff/etc/init.d/nfsd @ 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
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu May 26 20:16:45 2016 +0300 (2016-05-26)
parents 4d60a47b5df0
children ff5fd8788cd9
line diff
     1.1 --- a/nfs-utils/stuff/etc/init.d/nfsd	Tue Nov 16 10:46:29 2010 +0100
     1.2 +++ b/nfs-utils/stuff/etc/init.d/nfsd	Thu May 26 20:16:45 2016 +0300
     1.3 @@ -8,7 +8,7 @@
     1.4  . /etc/init.d/rc.functions
     1.5  
     1.6  NAME=NFSd
     1.7 -DESC="NFS Daemon"
     1.8 +DESC="$(_ '%s daemon' NFS)"
     1.9  DAEMON=/usr/sbin/rpc.nfsd
    1.10  PID_FILE=/var/run/nfsd.pid
    1.11  OPTION="8"
    1.12 @@ -16,24 +16,24 @@
    1.13  
    1.14  stop_warning()
    1.15  {
    1.16 -echo "Warning: filesystems are unexported but nfsd and lockd processes are still alive..."
    1.17 +  echo "Warning: filesystems are unexported but nfsd and lockd processes are still alive..."
    1.18  }
    1.19  
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PID_FILE nfsd ; 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 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.29      portmap="$(pidof portmap)"
    1.30      if [ -n "$portmap" ]; then
    1.31 -    	kill $portmap
    1.32 -    	sleep 2
    1.33 +      kill $portmap
    1.34 +      sleep 2
    1.35      fi
    1.36      [ -n "$(pidof rpcbind)" ] || rpcbind
    1.37      modprobe nfsd
    1.38 -    mount -t nfsd nfsd /proc/fs/nfsd 2> /dev/null
    1.39 +    mount -t nfsd nfsd /proc/fs/nfsd 2>/dev/null
    1.40      /usr/sbin/exportfs -r
    1.41      $DAEMON $OPTION
    1.42      pidof nfsd | awk '{print $1}' > $PID_FILE
    1.43 @@ -42,10 +42,10 @@
    1.44      ;;
    1.45    stop)
    1.46      if ! active_pidfile $PID_FILE nfsd ; 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 "Stopping $DESC: $NAME... "
    1.52 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.53      killall rpc.mountd
    1.54      killall nfsd
    1.55      killall lockd
    1.56 @@ -57,10 +57,10 @@
    1.57      ;;
    1.58    restart)
    1.59      if ! active_pidfile $PID_FILE nfsd ; then
    1.60 -      echo "$NAME is not running."
    1.61 +      _ '%s is not running.' $NAME
    1.62        exit 1
    1.63      fi
    1.64 -    echo -n "Restarting $DESC: $NAME... "
    1.65 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.66      killall rpc.mountd
    1.67      killall nfsd
    1.68      killall lockd
    1.69 @@ -74,9 +74,8 @@
    1.70      status
    1.71      ;;
    1.72    *)
    1.73 -    echo ""
    1.74 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.75 -    echo ""
    1.76 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.77 +    newline
    1.78      exit 1
    1.79      ;;
    1.80  esac