Skip to content

Commit

Permalink
v2.0b
Browse files Browse the repository at this point in the history
  • Loading branch information
DocDrydenn committed Jan 22, 2022
1 parent a2f2104 commit 674070d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions omsa_install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERS="v2.0a"
VERS="v2.0b"

# Clear screen
clear
Expand All @@ -16,20 +16,24 @@ DEBUG=0

# Script Update Function
self_update() {
echo "Status:"
cd "$SCRIPTPATH"
timeout 1s git fetch --quiet
timeout 1s git diff --quiet --exit-code "origin/$BRANCH" "$SCRIPTFILE"
[ $? -eq 1 ] && {
echo " ✗ Version: Mismatched."
echo "2a. Fetching Update:"
echo
echo "Fetching Update:"
if [ -n "$(git status --porcelain)" ]; # opposite is -z
then
git stash push -m 'local changes stashed before self update' --quiet
fi
git pull --force --quiet
git checkout $BRANCH --quiet
git pull --force --quiet
echo " ✓ Update Complete. Running New Version. Standby..."
echo " ✓ Update: Complete."
echo
echo "Launching New Version. Standby..."
sleep 3
cd - > /dev/null # return to original working dir
exec "$SCRIPTNAME" "${ARGS[@]}"
Expand Down

0 comments on commit 674070d

Please sign in to comment.