wok diff nginx-extras/stuff/etc/init.d/nginx @ rev 24934
updated musl-libc and musl-libc-dev (1.2.2 -> 1.2.3)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Apr 13 17:42:49 2022 +0100 (2022-04-13) |
parents | 4e10d83260c5 |
children | 3d13c41224cd |
line diff
1.1 --- a/nginx-extras/stuff/etc/init.d/nginx Thu Sep 17 16:29:50 2015 +0000 1.2 +++ b/nginx-extras/stuff/etc/init.d/nginx Wed Apr 13 17:42:49 2022 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 #!/bin/sh 1.5 -# /etc/init.d/nginx: Start, stop and restart web server on SliTaz, 1.6 +# /etc/init.d/nginx: Start, stop and restart web server on SliTaz, 1.7 # at boot time or with the command line. Daemons options are configured 1.8 # with /etc/daemons.conf 1.9 # 1.10 @@ -7,7 +7,7 @@ 1.11 . /etc/daemons.conf 1.12 1.13 NAME=Nginx 1.14 -DESC="web server" 1.15 +DESC="$(_ 'web server')" 1.16 DAEMON=/usr/sbin/nginx 1.17 OPTIONS=$NGINX_OPTIONS 1.18 PIDFILE=/var/run/nginx.pid 1.19 @@ -15,39 +15,38 @@ 1.20 case "$1" in 1.21 start) 1.22 if active_pidfile $PIDFILE nginx ; 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 - $DAEMON $OPTIONS 1.29 + action 'Starting %s: %s...' "$DESC" $NAME 1.30 + $DAEMON $OPTIONS 1.31 status 1.32 ;; 1.33 stop) 1.34 if ! active_pidfile $PIDFILE nginx ; then 1.35 - echo "$NAME is not running." 1.36 + _ '%s is not running.' $NAME 1.37 exit 1 1.38 fi 1.39 - echo -n "Stopping $DESC: $NAME... " 1.40 - kill `cat $PIDFILE` 1.41 + action 'Stopping %s: %s...' "$DESC" $NAME 1.42 + kill $(cat $PIDFILE) 1.43 rm $PIDFILE 1.44 status 1.45 ;; 1.46 restart) 1.47 if ! active_pidfile $PIDFILE nginx ; then 1.48 - echo "$NAME is not running." 1.49 + _ '%s is not running.' $NAME 1.50 exit 1 1.51 fi 1.52 - echo -n "Restarting $DESC: $NAME... " 1.53 - kill `cat $PIDFILE` 1.54 + action 'Restarting %s: %s...' "$DESC" $NAME 1.55 + kill $(cat $PIDFILE) 1.56 rm $PIDFILE 1.57 sleep 2 1.58 $DAEMON $OPTIONS 1.59 status 1.60 ;; 1.61 *) 1.62 - echo "" 1.63 - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.64 - echo "" 1.65 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.66 + newline 1.67 exit 1 1.68 ;; 1.69 esac