Skip to content

Commit 9b6ced1

Browse files
authored
Merge pull request #1756 from ryan-ronnander/improve-rhel-detection
ocf-distro: improve RHEL based distro detection
2 parents e0c8fc9 + 6cde49d commit 9b6ced1

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

heartbeat/ocf-distro

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ _process_os_release_id() {
3030

3131
# Normalize known distros to os-release names
3232
case "$_os" in
33+
*alma*)
34+
_os="almalinux"
35+
;;
3336
*centos*)
3437
_os="centos"
3538
;;
@@ -39,9 +42,15 @@ _process_os_release_id() {
3942
*fedora*)
4043
_os="fedora"
4144
;;
45+
*ol*)
46+
_os="ol"
47+
;;
4248
*redhat*|*rhel*|*scientific*)
4349
_os="rhel"
4450
;;
51+
*rocky*)
52+
_os="rocky"
53+
;;
4554
*opensuse*)
4655
_os="opensuse"
4756
;;
@@ -182,8 +191,8 @@ is_debian_based() {
182191

183192
# Returns true if the OS is Red Hat-based, otherwise false
184193
is_redhat_based() {
185-
get_release_id | grep -i -e "centos" -e "fedora" -e "redhat" -e "rhel" \
186-
-e "scientific" >/dev/null 2>&1
194+
get_release_id | grep -i -e "almalinux" -e "centos" -e "fedora" -e "ol" \
195+
-e "redhat" -e "rhel" -e "rocky" -e "scientific" >/dev/null 2>&1
187196
}
188197

189198
# Returns true if the OS is SUSE-based, otherwise false

0 commit comments

Comments
 (0)