salix/services/nginx/start.sh

26 lines
553 B
Bash
Raw Normal View History

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