Skip to content

Instantly share code, notes, and snippets.

@jacks205
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacks205/25f98c72db4b8b6be6b9 to your computer and use it in GitHub Desktop.
Save jacks205/25f98c72db4b8b6be6b9 to your computer and use it in GitHub Desktop.
Schedules update server script
#!/bin/bash
if [ $# -ge 2 ]
then
bash ~/launch.sh -k
if [ "$2" == "-f" ]
then
rm -r $1/
git clone https://github.com/jacks205/$1.git
cd ~/$1 && npm install
cp ~/local.js ~/$1/config/
fi
if [ "$2" == "-p" ]
then
cd ~/$1
git pull origin master
fi
bash ~/launch.sh
else
echo " update help"
echo " Make sure first parameter is name of git repo. i.e. schedules-backend"
echo " No argument default to server restart"
echo " Arguments"
echo " -f : Full update with new clone and npm install"
echo " -p : Partial update that pulls changes, May result in merge conflict"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment