Created
July 31, 2018 11:32
-
-
Save Kalvisan/e8c6e189f41ad9f4c540c3bd2c15fb1c to your computer and use it in GitHub Desktop.
Super simple git auto updater script
This file contains hidden or 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
| #!/bin/bash | |
| update() { | |
| cd $1 | |
| STATUS="$(git pull)" | |
| if [ "$STATUS" != "Already up-to-date." ] && [ "$STATUS" != "Already up to date." ] | |
| then | |
| echo "[$(/bin/date +%Y-%m-%d\ %H:%m)] $2 updated" | |
| echo $STATUS | |
| if [ "$3" != "" ] | |
| then | |
| service $3 restart | |
| fi | |
| fi | |
| } | |
| update /www/htdoc "Example Website" "service name" | |
| # update /www/htdoc/website2 "Example v2 Website" "service v2 name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment