27 lines
369 B
Bash
Executable File
27 lines
369 B
Bash
Executable File
#!/bin/sh
|
|
|
|
. /etc/init.d/init-functions
|
|
|
|
case "$1" in
|
|
start)
|
|
notify "Starting nginx "
|
|
nginx
|
|
echo $! > /var/run/nginx.pid
|
|
check $?
|
|
;;
|
|
stop)
|
|
notify "Stopping nginx "
|
|
nginx -s stop
|
|
rm /var/run/nginx.pid
|
|
check $?
|
|
;;
|
|
restart|reload)
|
|
"$0" stop
|
|
"$0" start
|
|
;;
|
|
*)
|
|
echo "nginx init script usage: $0 {start|stop|restart}"
|
|
return 1
|
|
esac
|
|
return $?
|