Force lower case proxy names for the pipectl installation runtime
@@ -54,6 +54,35 @@ function check_enough_disk {
return 0
}
+function str_to_lower_case {
+ local str="$1"
+ [ -z "$str" ] && return
+
+ echo "$str" | tr '[:upper:]' '[:lower:]'
+}
+
+# Converts any existing environment variable name to the lower case
+function var_to_lower_case {
+ local var_name="$1"
+ [ -z "$var_name" ] && return
+
+ local var_value="${!var_name}"
+ var_name_lower="$(str_to_lower_case "$var_name")"
+ unset "$var_name"
+ unset "$var_name_lower"
+ declare -xg "${var_name_lower}"="${var_value}"
+}
+
+# In certain cases - upper case http(s)/no_proxy variables are not consumed correctly
+# But it is common to see such approach, during the installation startup
+# So we rewrite them to the lower case
+function fix_http_proxies {
+ var_to_lower_case "HTTP_PROXY"
+ var_to_lower_case "HTTPS_PROXY"
+ var_to_lower_case "FTP_PROXY"
+ var_to_lower_case "NO_PROXY"
+}
+
function escape_comma_separated_values {
local value="$1"
IFS="," read -ra v_arr <<< "$value"
@@ -80,6 +109,7 @@ function run_preflight {
print_err "Unsopported Linux distribution. Centos 7 and above shall be used"
return 1
fi
+ fix_http_proxies
return 0
}
