28 lines
643 B
Bash
Executable File
28 lines
643 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 services"
|
|
forever start forever.json
|
|
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix"
|
|
cd @salix && gulp
|
|
;;
|
|
stop)
|
|
echo "################################ Stoping services"
|
|
forever stopall
|
|
"$nginxBin" -c "$nginxConf" -p "$nginxPrefix" -s stop
|
|
;;
|
|
*)
|
|
echo "Usage: `basename "$0"` [start|stop]"
|
|
exit 1
|
|
esac
|