2016-11-18 13:12:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-11-23 10:44:33 +00:00
|
|
|
nginxBin="/usr/sbin/nginx"
|
|
|
|
nginxPrefix="${PWD}/services/nginx"
|
|
|
|
nginxConf="$nginxPrefix/conf-dev.conf"
|
|
|
|
|
|
|
|
if [ ! -f $nginxBin ]; then
|
|
|
|
nginxBin="nginx"
|
|
|
|
fi
|
2016-11-18 13:12:57 +00:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start|"")
|
2016-11-23 10:44:33 +00:00
|
|
|
$0 stop
|
2017-05-16 10:37:48 +00:00
|
|
|
echo "Starting nginx."
|
2016-11-23 10:44:33 +00:00
|
|
|
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix"
|
2016-11-18 13:12:57 +00:00
|
|
|
;;
|
|
|
|
stop)
|
2017-05-16 10:37:48 +00:00
|
|
|
echo "Stoping nginx."
|
2016-11-23 10:44:33 +00:00
|
|
|
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix" -s stop
|
2016-11-18 13:12:57 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: `basename "$0"` [start|stop]"
|
|
|
|
exit 1
|
|
|
|
esac
|