Created
September 28, 2016 20:09
-
-
Save ultimagriever/4b6661d62d77ef1094788f5a85b31928 to your computer and use it in GitHub Desktop.
Automatically start Countdown development servers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chmod +x countdown.sh | |
ln -s $HOME/countdown.sh /usr/local/bin/countdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Usage: countdown {start|stop|restart} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment