From a2d8e72f407f0f8f0ad656677e5b84bbafdfcaa9 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 24 Oct 2024 18:29:00 +0000 Subject: [PATCH] Bash Array for download command --- kasmvnc/run.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kasmvnc/run.sh b/kasmvnc/run.sh index 696ca88e..f73e9788 100644 --- a/kasmvnc/run.sh +++ b/kasmvnc/run.sh @@ -20,17 +20,21 @@ download_file() { local download_tool if command -v curl &> /dev/null; then - download_tool="curl -fsSL" + # shellcheck disable=SC2034 + download_tool=(curl -fsSL) elif command -v wget &> /dev/null; then - download_tool="wget -q -O-" + # shellcheck disable=SC2034 + download_tool=(wget -q -O-) elif command -v busybox &> /dev/null; then - download_tool="busybox wget -O-" + # shellcheck disable=SC2034 + download_tool=(busybox wget -O-) else echo "ERROR: No download tool available (curl, wget, or busybox required)" exit 1 fi - $download_tool "$url" > "$output" || { + # shellcheck disable=SC2288 + "$${download_tool[@]}" "$url" > "$output" || { echo "ERROR: Failed to download $url" exit 1 }