diff --git a/README.md b/README.md index 521d4c0..a8f12ee 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ **New: [wireguard-install](https://github.com/Nyr/wireguard-install) is also available.** ## 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. diff --git a/openvpn-install.sh b/openvpn-install.sh index 25f93e3..e5a21d6 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -38,9 +38,17 @@ elif [[ -e /etc/fedora-release ]]; then os="fedora" os_version=$(grep -oE '[0-9]+' /etc/fedora-release | head -1) 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 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 fi @@ -61,6 +69,16 @@ if [[ "$os" == "centos" && "$os_version" -lt 7 ]]; then This version of CentOS is too old and unsupported." exit 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 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 apt-get update 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 openvpn openssl ca-certificates tar $firewall else