Merge dfd9808530 into 33452242a1
This commit is contained in:
commit
593f806ccc
@ -142,7 +142,7 @@ if [[ -e /etc/openvpn/server.conf ]]; then
|
|||||||
firewall-cmd --permanent --direct --remove-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
firewall-cmd --permanent --direct --remove-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
||||||
else
|
else
|
||||||
IP=$(grep 'iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to ' $RCLOCAL | cut -d " " -f 14)
|
IP=$(grep 'iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to ' $RCLOCAL | cut -d " " -f 14)
|
||||||
iptables -t nat -D POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
|
iptables -t nat -D POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to-source $IP
|
||||||
sed -i '/iptables -t nat -A POSTROUTING -s 10.8.0.0\/24 ! -d 10.8.0.0\/24 -j SNAT --to /d' $RCLOCAL
|
sed -i '/iptables -t nat -A POSTROUTING -s 10.8.0.0\/24 ! -d 10.8.0.0\/24 -j SNAT --to /d' $RCLOCAL
|
||||||
if iptables -L -n | grep -qE '^ACCEPT'; then
|
if iptables -L -n | grep -qE '^ACCEPT'; then
|
||||||
iptables -D INPUT -p $PROTOCOL --dport $PORT -j ACCEPT
|
iptables -D INPUT -p $PROTOCOL --dport $PORT -j ACCEPT
|
||||||
@ -422,4 +422,4 @@ verb 3" > /etc/openvpn/client-common.txt
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Your client configuration is available at" ~/"$CLIENT.ovpn"
|
echo "Your client configuration is available at" ~/"$CLIENT.ovpn"
|
||||||
echo "If you want to add more clients, you simply need to run this script again!"
|
echo "If you want to add more clients, you simply need to run this script again!"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user