From acf2879057beff483aa090f7badf5c72310cfaa8 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 25 May 2020 17:49:19 +0100 Subject: [PATCH] Address sticklr complaints Signed-off-by: Adam Warner --- automated install/basic-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index a7024ca5..6fdc6211 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -184,17 +184,17 @@ os_check() { display_warning=true detected_os_pretty=$(cat /etc/*release | grep PRETTY_NAME | cut -d '=' -f2- | tr -d '"') - detected_os=$(echo "${detected_os_pretty}" | sed 's/ .*//') + detected_os="${detected_os_pretty%% *}" detected_version=$(cat /etc/*release | grep VERSION_ID | cut -d '=' -f2- | tr -d '"') mapfile -t supportedOS < <(dig +short -t txt ${remote_os_domain} | tr -d '"' | tr ' ' '\n') for i in "${supportedOS[@]}" do - os_part=$(echo $i | cut -d '=' -f1) - versions_part=$(echo $i | cut -d '=' -f2-) + os_part=$(echo "$i" | cut -d '=' -f1) + versions_part=$(echo "$i" | cut -d '=' -f2-) - if [[ "${detected_os}" =~ "${os_part}" ]]; then + if [[ "${detected_os}" =~ ${os_part} ]]; then valid_os=true mapfile -t supportedVer < <(echo "${versions_part}" | tr ',' '\n') for x in "${supportedVer[@]}"