Add support for Rocky and Alma Linux

This commit is contained in:
cWashington91 2021-05-13 22:43:09 -05:00
parent cb8730b621
commit 44e4c14a87
2 changed files with 22 additions and 3 deletions

View File

@ -1,7 +1,8 @@
**New: [wireguard-install](https://github.com/Nyr/wireguard-install) is also available.** **New: [wireguard-install](https://github.com/Nyr/wireguard-install) is also available.**
## openvpn-install ## openvpn-install
OpenVPN [road warrior](http://en.wikipedia.org/wiki/Road_warrior_%28computing%29) installer for Ubuntu, Debian, CentOS and Fedora. OpenVPN [road warrior](http://en.wikipedia.org/wiki/Road_warrior_%28computing%29) installer for Ubuntu, Debian, CentOS, Fedora,
Rocky Linux, and Alma Linux
This script will let you set up your own VPN server in no more than a minute, even if you haven't used OpenVPN before. It has been designed to be as unobtrusive and universal as possible. This script will let you set up your own VPN server in no more than a minute, even if you haven't used OpenVPN before. It has been designed to be as unobtrusive and universal as possible.

View File

@ -38,9 +38,17 @@ elif [[ -e /etc/fedora-release ]]; then
os="fedora" os="fedora"
os_version=$(grep -oE '[0-9]+' /etc/fedora-release | head -1) os_version=$(grep -oE '[0-9]+' /etc/fedora-release | head -1)
group_name="nobody" group_name="nobody"
elif [[ -e /etc/os-release ]]; then
os="rocky"
os_version=$(grep -oE '[0-9]+' /etc/os-release | head -1)
group_name="nobody"
elif [[ -e /etc/os-release ]]; then
os="almalinux"
os_version=$(grep -oE '[0-9]+' /etc/os-release | head -1)
group_name="nobody"
else else
echo "This installer seems to be running on an unsupported distribution. echo "This installer seems to be running on an unsupported distribution.
Supported distributions are Ubuntu, Debian, CentOS, and Fedora." Supported distributions are Ubuntu, Debian, CentOS, Fedora, Rocky Linux, and Alma Linux."
exit exit
fi fi
@ -61,6 +69,16 @@ if [[ "$os" == "centos" && "$os_version" -lt 7 ]]; then
This version of CentOS is too old and unsupported." This version of CentOS is too old and unsupported."
exit exit
fi fi
if [[ "$os" == "rocky" && "$os_version" -lt 8 ]]; then
echo "Rocky Linux 8 or higher is required to use this installer.
This version of Rocky Linux is too old and unsupported."
exit
fi
if [[ "$os" == "almalinux" && "$os_version" -lt 8 ]]; then
echo "Alma Linux 8 or higher is required to use this installer.
This version of Alma Linux 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
@ -217,7 +235,7 @@ LimitNPROC=infinity" > /etc/systemd/system/openvpn-server@server.service.d/disab
if [[ "$os" = "debian" || "$os" = "ubuntu" ]]; then if [[ "$os" = "debian" || "$os" = "ubuntu" ]]; then
apt-get update apt-get update
apt-get install -y openvpn openssl ca-certificates $firewall apt-get install -y openvpn openssl ca-certificates $firewall
elif [[ "$os" = "centos" ]]; then elif [[ "$os" = "centos" || "$os" = "rocky" || "$os" = "almalinux" ]]; then
yum install -y epel-release yum install -y epel-release
yum install -y openvpn openssl ca-certificates tar $firewall yum install -y openvpn openssl ca-certificates tar $firewall
else else