Merge pull request #7 from janaz/fix-duplicate-remote

Don't insert duplicate ip addresses to the openvpn config file
This commit is contained in:
Quentin McGaw
2018-10-28 10:34:46 +01:00
committed by GitHub

View File

@@ -91,7 +91,7 @@ printf "\n * Adding IP addresses of $PIADOMAIN to /openvpn-$PROTOCOL-$ENCRYPTION
for ip in $VPNIPS for ip in $VPNIPS
do do
printf "\n remote $ip $PORT" printf "\n remote $ip $PORT"
echo "remote $ip $PORT" >> "/openvpn-$PROTOCOL-$ENCRYPTION/$REGION.ovpn" grep "remote $ip $PORT" "/openvpn-$PROTOCOL-$ENCRYPTION/$REGION.ovpn" || echo "remote $ip $PORT" >> "/openvpn-$PROTOCOL-$ENCRYPTION/$REGION.ovpn"
done done
printf "\n * Deleting all iptables rules..." printf "\n * Deleting all iptables rules..."
iptables --flush iptables --flush