wok diff ntp/stuff/ntp @ rev 25074
Add python-ipaddress
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jun 13 19:39:39 2022 +0000 (2022-06-13) |
parents | e1f16de14d6e |
children |
line diff
1.1 --- a/ntp/stuff/ntp Thu Jun 13 23:21:36 2013 +0200 1.2 +++ b/ntp/stuff/ntp Mon Jun 13 19:39:39 2022 +0000 1.3 @@ -1,5 +1,5 @@ 1.4 #!/bin/sh 1.5 -# /etc/init.d/ntp : Start, stop and restart ntp server on SliTaz, at 1.6 +# /etc/init.d/ntp : Start, stop and restart ntp server on SliTaz, at 1.7 # boot time or with the command line. 1.8 # 1.9 # To start ntp server at boot time, just put ntp in the $RUN_DAEMONS 1.10 @@ -9,49 +9,47 @@ 1.11 . /etc/daemons.conf 1.12 1.13 NAME=ntp 1.14 -DESC="ntp server" 1.15 +DESC="$(_ '%s server' NTP)" 1.16 DAEMON=/usr/bin/ntpd 1.17 OPTIONS=$NTP_OPTIONS 1.18 PIDFILE=/var/run/ntpd.pid 1.19 [ -n "$OPTIONS" ] || OPTIONS="-p $PIDFILE -c /etc/ntp.conf" 1.20 - 1.21 1.22 case "$1" in 1.23 start) 1.24 if active_pidfile $PIDFILE ntpd ; then 1.25 - echo "$NAME already running." 1.26 + _ '%s is already running.' $NAME 1.27 exit 1 1.28 fi 1.29 - echo -n "Starting $DESC: $NAME... " 1.30 + action 'Starting %s: %s...' "$DESC" $NAME 1.31 $DAEMON $OPTIONS 1.32 status 1.33 pgrep $DAEMON > $PIDFILE # it seems that -p doesn't work ? 1.34 ;; 1.35 stop) 1.36 if ! active_pidfile $PIDFILE ntpd ; then 1.37 - echo "$NAME is not running." 1.38 + _ '%s is not running.' $NAME 1.39 exit 1 1.40 fi 1.41 - echo -n "Stopping $DESC: $NAME... " 1.42 - kill `cat $PIDFILE` 1.43 + action 'Stopping %s: %s...' "$DESC" $NAME 1.44 + kill $(cat $PIDFILE) 1.45 rm $PIDFILE 1.46 status 1.47 ;; 1.48 restart) 1.49 if ! active_pidfile $PIDFILE ntpd ; then 1.50 - echo "$NAME is not running." 1.51 + _ '%s is not running.' $NAME 1.52 exit 1 1.53 fi 1.54 - echo -n "Restarting $DESC: $NAME... " 1.55 - kill `cat $PIDFILE` 1.56 + action 'Restarting %s: %s...' "$DESC" $NAME 1.57 + kill $(cat $PIDFILE) 1.58 $DAEMON $OPTIONS 1.59 status 1.60 pgrep $DAEMON > $PIDFILE # it seems that -p doesn't work ? 1.61 ;; 1.62 *) 1.63 - echo "" 1.64 - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.65 - echo "" 1.66 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.67 + newline 1.68 exit 1 1.69 ;; 1.70 esac