...
 
Commits (2)
......@@ -12,18 +12,20 @@ REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
echo "Already up to date. Aborting update."
exit
echo "[INFO] Already up to date. Aborting update."
exit 0
elif [ $REMOTE = $BASE ]; then
echo "local repo contains commits not pushed to remote yet. Cleanup and execute this command again. Aborting update."
exit
echo "[ERROR] Local repo contains commits not pushed to remote yet. Cleanup and execute this command again. Aborting update." 1>&2
exit 1
elif [ $LOCAL = $BASE ]; then
echo "Update available. Pulling and restarting service..."
echo "[INFO] Update available. Pulling and restarting service..."
git pull
systemctl restart hubscreen_client.service
echo "service updated and restarted."
echo "[INFO] Service updated and restarted."
exit 0
else
echo "Local and remote master branches diverged. Cleanup and execute this command again. Aborting update."
echo "[ERROR] Local and remote master branches diverged. Cleanup and execute this command again. Aborting update." 1>&2
exit 1
fi