From 19c931abb0f7797d19623b8bb6fcf7f6949da3ce Mon Sep 17 00:00:00 2001 From: agboola Date: Wed, 16 Jul 2025 15:14:32 +0100 Subject: [PATCH] get_os_type function updated minor changes to awk command to determin os-release type change redhat to rhel in function --- lego_wrapper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lego_wrapper.sh b/lego_wrapper.sh index 1a14be5..170088f 100644 --- a/lego_wrapper.sh +++ b/lego_wrapper.sh @@ -220,14 +220,14 @@ get_system_information() { get_os_type() { #get OSTYPE - modify to know defualt package name to use for installation - os_type=$(awk -F'=' '/ID_LIKE/ {print $2}' /etc/os-release | awk -F'"' '{print $2}') + os_type=$(awk -F'=' '/^ID/ {print $2}' /etc/os-release') if [[ $os_type == *"debian"* ]]; then install_cmd="apt" elif [[ $os_type == *"ubuntu"* ]]; then install_cmd="apt" elif [[ $os_type == *"almalinux"* ]]; then install_cmd="yum" - elif [[ $os_type == *"redhat"* ]]; then + elif [[ $os_type == *"rhel"* ]]; then install_cmd="yum" elif [[ $os_type == *"centos"* ]]; then install_cmd="yum" -- 2.47.3