1
0
mirror of https://github.com/Nyr/openvpn-install.git synced 2024-11-24 05:56:08 +03:00
This commit is contained in:
kenzie tandun 2017-03-01 12:17:29 +07:00
parent 7d93fbf62f
commit 8e980eb2ea

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# OpenVPN road warrior installer for Debian, Ubuntu and CentOS # OpenVPN road warrior installer for Debian, Ubuntu, openSUSE and CentOS
# This script will work on Debian, Ubuntu, CentOS and probably other distros # This script will work on Debian, Ubuntu, openSUSE, CentOS and probably other distros
# of the same families, although no support is offered for them. It isn't # of the same families, although no support is offered for them. It isn't
# bulletproof but it will probably work if you simply want to setup a VPN on # bulletproof but it will probably work if you simply want to setup a VPN on
# your Debian/Ubuntu/CentOS box. It has been designed to be as unobtrusive and # your Debian/Ubuntu/CentOS box. It has been designed to be as unobtrusive and
@ -36,8 +36,12 @@ elif [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
OS=centos OS=centos
GROUPNAME=nobody GROUPNAME=nobody
RCLOCAL='/etc/rc.d/rc.local' RCLOCAL='/etc/rc.d/rc.local'
elif [[ -e /etc/SuSE-release ]]; then
OS=opensuse
GROUPNAME=nobody
RCLOCAL='/etc/rc.d/rc.local'
else else
echo "Looks like you aren't running this installer on a Debian, Ubuntu or CentOS system" echo "Looks like you aren't running this installer on a Debian, Ubuntu, openSUSE or CentOS system"
exit 5 exit 5
fi fi
@ -157,6 +161,9 @@ if [[ -e /etc/openvpn/server.conf ]]; then
fi fi
if [[ "$OS" = 'debian' ]]; then if [[ "$OS" = 'debian' ]]; then
apt-get remove --purge -y openvpn openvpn-blacklist apt-get remove --purge -y openvpn openvpn-blacklist
elif [[ "$OS" = 'opensuse' ]]; then
echo "openSUSE OS detected"
zypper rm -y openvpn
else else
yum remove openvpn -y yum remove openvpn -y
fi fi
@ -219,6 +226,8 @@ else
if [[ "$OS" = 'debian' ]]; then if [[ "$OS" = 'debian' ]]; then
apt-get update apt-get update
apt-get install openvpn iptables openssl ca-certificates -y apt-get install openvpn iptables openssl ca-certificates -y
elif [[ "$OS" = 'opensuse' ]]; then
zypper install -y openvpn
else else
# Else, the distro is CentOS # Else, the distro is CentOS
yum install epel-release -y yum install epel-release -y