Created
July 31, 2018 11:32
-
-
Save Kalvisan/e8c6e189f41ad9f4c540c3bd2c15fb1c to your computer and use it in GitHub Desktop.
Revisions
-
Kalvisan created this gist
Jul 31, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/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"