Use ret_code in prereq function to return failures

This commit is contained in:
William Wernert
2022-01-20 13:53:59 -05:00
parent 1b860e11e7
commit 357cd059aa

View File

@@ -169,11 +169,15 @@ __check_url_arr() {
} }
preflight_prereqs() { preflight_prereqs() {
local ret_code=0
if [[ $OS == 'centos' ]]; then if [[ $OS == 'centos' ]]; then
: # no-op to match structure of other checks for $OS var : # no-op to match structure of other checks for $OS var
else else
retry 50 10 "apt-get -y install curl" >> "$preflight_log" 2>&1 || exit 1 retry 50 10 "apt-get -y install curl" >> "$preflight_log" 2>&1 || ret_code=1
fi fi
return $ret_code
} }
main() { main() {
@@ -190,6 +194,7 @@ main() {
else else
echo "$intro_str" | tee "$preflight_log" echo "$intro_str" | tee "$preflight_log"
fi fi
check_default_repos &&\ check_default_repos &&\
preflight_prereqs &&\ preflight_prereqs &&\
check_new_repos &&\ check_new_repos &&\