From 7ace374dfe2039e46d5ae3d609a1c89c3138d450 Mon Sep 17 00:00:00 2001 From: Scott B <28817345+foundObjects@users.noreply.github.com> Date: Wed, 22 Jan 2020 04:19:57 -0800 Subject: [PATCH] prettied up installer output --- install.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index b5b9880..d669c81 100755 --- a/install.sh +++ b/install.sh @@ -109,10 +109,10 @@ _install() { }; EOF - echo "Installing script to /usr/share/pve-nag-buster.sh" + # install the hook script temp='' if [ "$1" = "--offline" ]; then - # offline mode, emit stored script + # packed script requested temp="$(mktemp)" && trap "rm -f $temp" EXIT emit_script > "$temp" elif [ -f "pve-nag-buster.sh" ]; then @@ -120,12 +120,19 @@ _install() { temp="pve-nag-buster.sh" else # fetch from github - temp="$(mktemp)" && trap "rm -f $temp" EXIT + echo "Fetching hook script from GitHub ..." + tempd="$(mktemp -d)" && + trap "echo 'Cleaning up temporary files ...'; rm -f $tempd/*; rmdir $tempd" EXIT + temp="$tempd/pve-nag-buster.sh" wget https://raw.githubusercontent.com/foundObjects/pve-nag-buster/master/pve-nag-buster.sh \ - -O "$temp" + -q --show-progress -O "$temp" fi + echo "Installing hook script as /usr/share/pve-nag-buster.sh" install -o root -m 0550 "$temp" "/usr/share/pve-nag-buster.sh" + + echo "Running patch script" /usr/share/pve-nag-buster.sh + return 0 }