mirror of
https://github.com/Nyr/openvpn-install.git
synced 2025-04-05 05:33:30 +03:00
Adding support for Amazon Linux 2
This commit is contained in:
parent
cb8730b621
commit
b28605c82e
1 changed files with 15 additions and 3 deletions
|
@ -38,9 +38,13 @@ elif [[ -e /etc/fedora-release ]]; then
|
|||
os="fedora"
|
||||
os_version=$(grep -oE '[0-9]+' /etc/fedora-release | head -1)
|
||||
group_name="nobody"
|
||||
elif grep -qs "Amazon Linux" /etc/system-release; then
|
||||
os="al2"
|
||||
os_version=$(grep -oE '[0-9]+' /etc/system-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 and Amazon Linux."
|
||||
exit
|
||||
fi
|
||||
|
||||
|
@ -62,6 +66,14 @@ This version of CentOS is too old and unsupported."
|
|||
exit
|
||||
fi
|
||||
|
||||
if [[ "$os" == "al2" && "$os_version" -lt 2 ]]; then
|
||||
echo "Amazon Linux 2 or higher is required to use this installer.
|
||||
This version of Amazon Linux is too old and unsupported."
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Detect environments where $PATH does not include the sbin directories
|
||||
if ! grep -q sbin <<< "$PATH"; then
|
||||
echo '$PATH does not include sbin. Try using "su -" instead of "su".'
|
||||
|
@ -197,7 +209,7 @@ if [[ ! -e /etc/openvpn/server/server.conf ]]; then
|
|||
echo "OpenVPN installation is ready to begin."
|
||||
# Install a firewall in the rare case where one is not already available
|
||||
if ! systemctl is-active --quiet firewalld.service && ! hash iptables 2>/dev/null; then
|
||||
if [[ "$os" == "centos" || "$os" == "fedora" ]]; then
|
||||
if [[ "$os" == "centos" || "$os" == "fedora" || "$os" == "al2" ]]; then
|
||||
firewall="firewalld"
|
||||
# We don't want to silently enable firewalld, so we give a subtle warning
|
||||
# If the user continues, firewalld will be installed and enabled during setup
|
||||
|
@ -217,7 +229,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" = "al2" ]]; then
|
||||
yum install -y epel-release
|
||||
yum install -y openvpn openssl ca-certificates tar $firewall
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue