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")"
|
lsb_dist="$(. /etc/os-release && echo "$ID")"
|
||||||
fi
|
fi
|
||||||
# Updates the "lsb_dist" variable for the CentOS forks
|
# Updates the "lsb_dist" variable for the CentOS forks
|
||||||
# new IDs will be updated in the future.
|
# by checking the file "redhat-release" present in the Red Hat based distros.
|
||||||
case "$lsb_dist" in
|
if [ -r /etc/redhat-release ]; then
|
||||||
almalinux)
|
if ! egrep -i "centos|redhat|red hat|fedora" /etc/redhat-release; then
|
||||||
|
echo "Forked distribution, switching to CentOS ID"
|
||||||
lsb_dist="centos"
|
lsb_dist="centos"
|
||||||
;;
|
fi
|
||||||
esac
|
fi
|
||||||
# Returning an empty string here should be alright since the
|
# Returning an empty string here should be alright since the
|
||||||
# case statements don't act unless you provide an actual value
|
# case statements don't act unless you provide an actual value
|
||||||
echo "$lsb_dist"
|
echo "$lsb_dist"
|
||||||
|
|
Loading…
Reference in New Issue