Merge pull request 'get_os_type function updated' (#3) from patch-1.1 into main
Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
+2
-2
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user