mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-12-03 18:36:07 +03:00
Add redhat8 support
This commit is contained in:
parent
94c94bbbc9
commit
588cfb012c
@ -30,9 +30,13 @@ elif [[ -e /etc/debian_version ]]; then
|
|||||||
os="debian"
|
os="debian"
|
||||||
os_version=$(grep -oE '[0-9]+' /etc/debian_version | head -1)
|
os_version=$(grep -oE '[0-9]+' /etc/debian_version | head -1)
|
||||||
group_name="nogroup"
|
group_name="nogroup"
|
||||||
elif [[ -e /etc/almalinux-release || -e /etc/rocky-release || -e /etc/centos-release ]]; then
|
elif [[ -e /etc/almalinux-release || -e /etc/rocky-release || -e /etc/centos-release || -e /etc/redhat-release ]]; then
|
||||||
os="centos"
|
os="centos"
|
||||||
os_version=$(grep -shoE '[0-9]+' /etc/almalinux-release /etc/rocky-release /etc/centos-release | head -1)
|
os_version=$(grep -shoE '[0-9]+' /etc/almalinux-release /etc/rocky-release /etc/centos-release /etc/redhat-release | head -1)
|
||||||
|
group_name="nobody"
|
||||||
|
elif [[ -e /etc/redhat-release ]]; then
|
||||||
|
os="redhat"
|
||||||
|
os_version=$(grep -shoE '[0-9]+' /etc/redhat-release | head -1)
|
||||||
group_name="nobody"
|
group_name="nobody"
|
||||||
elif [[ -e /etc/fedora-release ]]; then
|
elif [[ -e /etc/fedora-release ]]; then
|
||||||
os="fedora"
|
os="fedora"
|
||||||
@ -62,6 +66,12 @@ This version of CentOS is too old and unsupported."
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$os" == "RedHat" && "$os_version" -lt 7 ]]; then
|
||||||
|
echo "RedHat 7 or higher is required to use this installer.
|
||||||
|
This version of RedHat is too old and unsupported."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Detect environments where $PATH does not include the sbin directories
|
# Detect environments where $PATH does not include the sbin directories
|
||||||
if ! grep -q sbin <<< "$PATH"; then
|
if ! grep -q sbin <<< "$PATH"; then
|
||||||
echo '$PATH does not include sbin. Try using "su -" instead of "su".'
|
echo '$PATH does not include sbin. Try using "su -" instead of "su".'
|
||||||
@ -73,6 +83,16 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "`sudo rpm -ql epel-release`" == "package epel-release is not installed" ]]; then
|
||||||
|
echo "EPEL is not installed, please install EPEL"
|
||||||
|
echo "For RedHat 8.x: https://linuxconfig.org/redhat-8-epel-install-guide"
|
||||||
|
echo "For RedHat 7.x: https://www.unixmen.com/install-epel-repository-centos-rhel-7/"
|
||||||
|
echo "or search by your self :D"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -e /dev/net/tun ]] || ! ( exec 7<>/dev/net/tun ) 2>/dev/null; then
|
if [[ ! -e /dev/net/tun ]] || ! ( exec 7<>/dev/net/tun ) 2>/dev/null; then
|
||||||
echo "The system does not have the TUN device available.
|
echo "The system does not have the TUN device available.
|
||||||
TUN needs to be enabled before running this installer."
|
TUN needs to be enabled before running this installer."
|
||||||
|
Loading…
Reference in New Issue
Block a user