Changed the check for Red Hat forks
Instead of checking for the new CentOS forks IDs, the check is made on the file "redhat-release". This should include any future fork without the need to update this script. I kept the check in the "get_distribution()" function, but let me know if it would make sense to have a "check_forked_redhat()" function instead, in order to stay aligned with the current script logic.
This commit is contained in:
parent
e37ddadc3f
commit
d471636480
11
install.sh
11
install.sh
|
@ -121,12 +121,13 @@ get_distribution() {
|
|||
lsb_dist="$(. /etc/os-release && echo "$ID")"
|
||||
fi
|
||||
# Updates the "lsb_dist" variable for the CentOS forks
|
||||
# new IDs will be updated in the future.
|
||||
case "$lsb_dist" in
|
||||
almalinux)
|
||||
# by checking the file "redhat-release" present in the Red Hat based distros.
|
||||
if [ -r /etc/redhat-release ]; then
|
||||
if ! egrep -i "centos|redhat|red hat|fedora" /etc/redhat-release; then
|
||||
echo "Forked distribution, switching to CentOS ID"
|
||||
lsb_dist="centos"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
# Returning an empty string here should be alright since the
|
||||
# case statements don't act unless you provide an actual value
|
||||
echo "$lsb_dist"
|
||||
|
|
Loading…
Reference in New Issue