get_os_type function updated

minor changes to awk command to determin os-release type
change redhat to rhel in function
This commit is contained in:
2025-07-16 15:14:32 +01:00
parent bcf6afad42
commit 19c931abb0
+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"