diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 665162859..f40959f0d 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -233,8 +233,8 @@ fn_update_function(){ # Defines curl path -curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" -for curlpath in "${curlpaths}" +curl_paths_array=($(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl) +for curlpath in "${curl_paths_array}" do if [ -x "${curlpath}" ]; then break diff --git a/linuxgsm.sh b/linuxgsm.sh index 7270b3b87..dd8357855 100644 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -63,9 +63,9 @@ fn_bootstrap_fetch_file(){ if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlpath in ${curlpaths} + # Defines curl path + curl_paths_array=($(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl) + for curlpath in "${curl_paths_array}" do if [ -x "${curlpath}" ]; then break