salix/services/nginx/start.sh

26 lines
553 B
Bash
Executable File

#!/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
echo "Starting nginx."
mkdir -p "$nginxPrefix/temp"
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix" 2>> /dev/null
;;
stop)
echo "Stoping nginx."
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix" -s stop 2>> /dev/null
;;
*)
echo "Usage: `basename "$0"` [start|stop]"
exit 1
esac