Skip to content

Commit

Permalink
Add CentOS Stream support to OS check function (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
arsci authored Jul 29, 2024
1 parent 7b44cfc commit 71f6156
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/bash-commons/src/os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ function os_is_ubuntu {
grep -q "Ubuntu $version" /etc/*release
}

# Returns true (0) if this is a CentOS server at the given version or false (1) otherwise. The version number
# Returns true (0) if this is a CentOS/CentOS Stream server at the given version or false (1) otherwise. The version number
# can use regex. If you don't care about the version, leave it unspecified.
function os_is_centos {
local -r version="$1"
grep -q "CentOS Linux release $version" /etc/*release
grep -q "CentOS Linux release $version" /etc/*release || grep -q "CentOS Stream release $version" /etc/*release
}

# Returns true (0) if this is a RedHat server at the given version or false (1) otherwise. The version number
Expand Down

0 comments on commit 71f6156

Please sign in to comment.