wok view nginx-extras/stuff/etc/init.d/nginx @ rev 24995

updated nginx and nginx-extras (1.19.0 -> 1.21.6)
author Hans-G?nter Theisgen
date Mon May 16 10:04:06 2022 +0100 (23 months ago)
parents 7f188676b59c
children
line source
1 #!/bin/sh
2 # /etc/init.d/nginx: Start, stop and restart web server on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=Nginx
10 DESC="$(_ 'web server')"
11 DAEMON=/usr/sbin/nginx
12 OPTIONS=$NGINX_OPTIONS
13 PIDFILE=/var/run/nginx.pid
15 case "$1" in
16 (start)
17 if active_pidfile $PIDFILE nginx
18 then
19 _ '%s is already running.' $NAME
20 exit 1
21 fi
22 newline
23 action 'Starting %s: %s...' "$DESC" $NAME
24 $DAEMON $OPTIONS
25 status
26 ;;
27 (stop)
28 if ! active_pidfile $PIDFILE nginx
29 then
30 _ '%s is not running.' $NAME
31 exit 1
32 fi
33 action 'Stopping %s: %s...' "$DESC" $NAME
34 kill $(cat $PIDFILE)
35 status
36 ;;
37 (restart)
38 if ! active_pidfile $PIDFILE nginx
39 then
40 _ '%s is not running.' $NAME
41 exit 1
42 fi
43 action 'Restarting %s: %s...' "$DESC" $NAME
44 kill $(cat $PIDFILE)
45 sleep 2
46 $DAEMON $OPTIONS
47 status
48 ;;
49 (*)
50 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
51 newline
52 exit 1
53 ;;
54 esac
56 exit 0