Merge pull request #6909 from Security-Onion-Solutions/fix/preflight-curl

Install curl in preflight script to avoid error on Ubuntu
This commit is contained in:
William Wernert
2022-01-18 13:39:44 -05:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@@ -1156,8 +1156,10 @@ installer_prereq_packages() {
systemctl start NetworkManager
} >> "$setup_log" 2<&1
fi
if ! command -v curl > /dev/null 2>&1; then
retry 50 10 "apt-get -y install curl" >> "$setup_log" 2>&1 || exit 1
fi
fi
}
disable_auto_start() {

View File

@@ -168,6 +168,14 @@ __check_url_arr() {
return $ret_code
}
preflight_prereqs() {
if [[ $OS == 'centos' ]]; then
: # no-op to match structure of other checks for $OS var
else
retry 50 10 "apt-get -y install curl" >> "$preflight_log" 2>&1 || exit 1
fi
}
main() {
local intro_str="Beginning pre-flight checks."
local success_str="Pre-flight checks completed successfully!"
@@ -183,6 +191,7 @@ main() {
echo "$intro_str" | tee "$preflight_log"
fi
check_default_repos &&\
preflight_prereqs &&\
check_new_repos &&\
check_misc_urls