get_os_type function updated #3

Merged
agboola merged 1 commits from patch-1.1 into main 2025-07-16 15:15:39 +01:00
+2 -2
View File
@@ -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"