mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-11-23 21:46:08 +03:00
Remove wget dependency in CentOS
curl is always included with CentOS and wget is always included with Debian/Ubuntu. So it was useless to install wget in CentOS like we were doing for those cases when it wasn't already installed. Now curl will be used instead.
This commit is contained in:
parent
2726a148ee
commit
cb28b57e09
@ -219,19 +219,20 @@ else
|
||||
else
|
||||
# Else, the distro is CentOS
|
||||
yum install epel-release -y
|
||||
yum install openvpn iptables openssl wget ca-certificates -y
|
||||
yum install openvpn iptables openssl ca-certificates -y
|
||||
fi
|
||||
# An old version of easy-rsa was available by default in some openvpn packages
|
||||
if [[ -d /etc/openvpn/easy-rsa/ ]]; then
|
||||
rm -rf /etc/openvpn/easy-rsa/
|
||||
fi
|
||||
# Get easy-rsa
|
||||
wget -O ~/EasyRSA-3.0.4.tgz "https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.4/EasyRSA-3.0.4.tgz"
|
||||
tar xzf ~/EasyRSA-3.0.4.tgz -C ~/
|
||||
EASYRSAURL='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.4/EasyRSA-3.0.4.tgz'
|
||||
wget -O ~/easyrsa.tgz "$EASYRSAURL" 2>/dev/null || curl -Lo ~/easyrsa.tgz "$EASYRSAURL"
|
||||
tar xzf ~/easyrsa.tgz -C ~/
|
||||
mv ~/EasyRSA-3.0.4/ /etc/openvpn/
|
||||
mv /etc/openvpn/EasyRSA-3.0.4/ /etc/openvpn/easy-rsa/
|
||||
chown -R root:root /etc/openvpn/easy-rsa/
|
||||
rm -rf ~/EasyRSA-3.0.4.tgz
|
||||
rm -rf ~/easyrsa.tgz
|
||||
cd /etc/openvpn/easy-rsa/
|
||||
# Create the PKI, set up the CA, the DH params and the server + client certificates
|
||||
./easyrsa init-pki
|
||||
@ -375,7 +376,7 @@ exit 0' > $RCLOCAL
|
||||
fi
|
||||
fi
|
||||
# Try to detect a NATed connection and ask about it to potential LowEndSpirit users
|
||||
EXTERNALIP=$(wget -4qO- "http://whatismyip.akamai.com/")
|
||||
EXTERNALIP=$(wget -4qO- "http://whatismyip.akamai.com/" 2>/dev/null || curl -4s "http://whatismyip.akamai.com/")
|
||||
if [[ "$IP" != "$EXTERNALIP" ]]; then
|
||||
echo ""
|
||||
echo "Looks like your server could be behind a NAT!"
|
||||
|
Loading…
Reference in New Issue
Block a user