diff --git a/openvpn-install.sh b/openvpn-install.sh index 7faedd6..8d048d6 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -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!"