From ca455cd9a5f916731f85fea9c5200d0a6e9fb440 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Tue, 14 Jun 2022 23:28:13 +0000 Subject: [PATCH] cleanup add git reset in the event a user chmod +x the script. remove continue from if statement.. it didn't do anything --- heavy_script.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/heavy_script.sh b/heavy_script.sh index f8d87e8c..e0ae0adb 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -14,13 +14,14 @@ git fetch &> /dev/null [[ -n $(git diff --name-only origin/main | grep $SCRIPTNAME) ]] && { echo "Found a new version of HeavyScript, updating myself..." - git pull --force &> /dev/null + git reset --hard -q + git pull --force -q echo -e "Running the new version...\n" count=0 for i in "${args[@]}" do - [[ "$i" == "--self-update" ]] && unset "args[$count]" && break - ((count++)) + [[ "$i" == "--self-update" ]] && unset "args[$count]" && break + ((count++)) done sleep 5 exec bash "$SCRIPTNAME" "${args[@]}" @@ -57,7 +58,7 @@ echo "Examples" echo "bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -i radarr -t 600 -vrsUp" echo "bash /mnt/tank/scripts/heavy_script.sh -t 150 --mount" echo "bash /mnt/tank/scripts/heavy_script.sh --dns" -echo "bash /mnt/tank/scripts/heavy_script.sh --restore" +echo "bash --restore" echo "bash /mnt/tank/scripts/heavy_script.sh --delete-backup" echo exit @@ -267,7 +268,7 @@ do else #user must not be using -S, just update echo -e "\n$app_name" [[ "$verbose" == "true" ]] && echo "Updating.." - cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo -e "Updated\n$old_full_ver\n$new_full_ver" && after_update_actions || { echo "FAILED"; continue; } + cli -c 'app chart_release upgrade release_name=''"'"$app_name"'"' &> /dev/null && echo -e "Updated\n$old_full_ver\n$new_full_ver" && after_update_actions || echo "FAILED" fi else echo -e "\n$app_name\nMajor Release, update manually"