From 4a2bc2dded8d365e04179f6dfb764430c0f06fa6 Mon Sep 17 00:00:00 2001 From: mag37 Date: Sun, 5 Mar 2023 13:50:28 +0100 Subject: [PATCH] Cleaning Quoted a variable, reformatted a message --- dockcheck.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockcheck.sh b/dockcheck.sh index 063d82d..f3dae47 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -41,13 +41,13 @@ shift "$((OPTIND-1))" self_update_git() { cd "$ScriptWorkDir" || { printf "Path error, skipping update.\n" ; return ; } [[ $(builtin type -P git) ]] || { printf "Git not installed, skipping update.\n" ; return ; } - ScriptUpstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream}) || { printf "Script not in cloned directory, skipping update.\n" ; return ; } + ScriptUpstream=$(git rev-parse --abbrev-ref --symbolic-full-name "@{upstream}") || { printf "Script not in cloned directory, skipping update.\n" ; return ; } git fetch [ -n "$(git diff --name-only "$ScriptUpstream" "$ScriptName")" ] && { printf "%s\n" "Pulling the latest version." # git checkout "$ScriptUpstream" git pull --force - echo "Running the new version..." + printf "%s\n" "--- starting over with the updated version ---" cd - || { printf "Path error.\n" ; return ; } exec "$ScriptPath" "${ScriptArgs[@]}" # run the new script with old arguments exit 1 # exit the old instance