From c0c42c35749853682095696e413347b43d36d601 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Tue, 18 Jan 2022 13:17:56 -0500 Subject: [PATCH] Install curl in preflight script to avoid error on Ubuntu Also add check for already installed curl later in setup --- setup/so-functions | 4 +++- setup/so-preflight | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/setup/so-functions b/setup/so-functions index 6bc7bed70..d2c200ad1 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1156,7 +1156,9 @@ installer_prereq_packages() { systemctl start NetworkManager } >> "$setup_log" 2<&1 fi - retry 50 10 "apt-get -y install curl" >> "$setup_log" 2>&1 || exit 1 + 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 } diff --git a/setup/so-preflight b/setup/so-preflight index 3050c94cb..7719bc966 100755 --- a/setup/so-preflight +++ b/setup/so-preflight @@ -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