Skip to content

Instantly share code, notes, and snippets.

@ultimagriever
Created September 28, 2016 20:09
Show Gist options
  • Save ultimagriever/4b6661d62d77ef1094788f5a85b31928 to your computer and use it in GitHub Desktop.
Save ultimagriever/4b6661d62d77ef1094788f5a85b31928 to your computer and use it in GitHub Desktop.
Automatically start Countdown development servers
chmod +x countdown.sh
ln -s $HOME/countdown.sh /usr/local/bin/countdown
MODE=$1
declare -a PATHS=('countdown-service' 'countdown-manager')
for path in "${PATHS[@]}"
do
cd $HOME/Sites/$path
case $MODE in
start)
pm2 start server.js --name $path
;;
restart)
pm2 restart $path
;;
stop)
pm2 stop $path
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
done
exit 1
Usage: countdown {start|stop|restart}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment