🔒 Repository is read-only – file editing is disabled.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
#/bin/sh
. /lib/lsb/init-functions
DAEMON=/usr/sbin/nginx
PIDFILE=/var/run/nginx.pid
start() {
log_info_msg "Starting Nginx Server..."
$DAEMON
evaluate_retval
}
stop() {
log_info_msg "Stopping Nginx Server..."
$DAEMON -s quit
evaluate_retval
}
reload() {
log_info_msg "Reloading Nginx Server..."
$DAEMON -s reload
evaluate_retval
}
status() {
pid=`pidof $DAEMON`
if [ "$pid" ]; then
echo "Nginx running on PID $pid"
else
echo "Nginx is not running"
fi
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
force-reload)
reload
;;
*)
echo "Syntax: $0 <start|stop|restart|status|force-reload>"
;;
esac