1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -109,23 +109,30 @@ _install() {
109
109
};
110
110
EOF
111
111
112
- echo " Installing script to /usr/share/pve-nag-buster.sh "
112
+ # install the hook script
113
113
temp=' '
114
114
if [ " $1 " = " --offline" ]; then
115
- # offline mode, emit stored script
115
+ # packed script requested
116
116
temp=" $( mktemp) " && trap " rm -f $temp " EXIT
117
117
emit_script > " $temp "
118
118
elif [ -f " pve-nag-buster.sh" ]; then
119
119
# local copy available
120
120
temp=" pve-nag-buster.sh"
121
121
else
122
122
# fetch from github
123
- temp=" $( mktemp) " && trap " rm -f $temp " EXIT
123
+ echo " Fetching hook script from GitHub ..."
124
+ tempd=" $( mktemp -d) " &&
125
+ trap " echo 'Cleaning up temporary files ...'; rm -f $tempd /*; rmdir $tempd " EXIT
126
+ temp=" $tempd /pve-nag-buster.sh"
124
127
wget https://raw.githubusercontent.com/foundObjects/pve-nag-buster/master/pve-nag-buster.sh \
125
- -O " $temp "
128
+ -q --show-progress - O " $temp "
126
129
fi
130
+ echo " Installing hook script as /usr/share/pve-nag-buster.sh"
127
131
install -o root -m 0550 " $temp " " /usr/share/pve-nag-buster.sh"
132
+
133
+ echo " Running patch script"
128
134
/usr/share/pve-nag-buster.sh
135
+
129
136
return 0
130
137
}
131
138
0 commit comments