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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user