From d32416561b006253994398c42f8d0fbedd4edf9e Mon Sep 17 00:00:00 2001 From: Nyr Date: Wed, 7 Oct 2015 19:57:04 +0200 Subject: [PATCH] Grep for DROP as well as REJECT --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index dbf7084..adf7a90 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -135,7 +135,7 @@ if [[ -e /etc/openvpn/server.conf ]]; then firewall-cmd --permanent --zone=public --remove-port=$PORT/udp firewall-cmd --permanent --zone=trusted --remove-source=10.8.0.0/24 fi - if iptables -L | grep -q REJECT; then + if iptables -L | grep -qE 'REJECT|DROP'; then sed -i "/iptables -I INPUT -p udp --dport $PORT -j ACCEPT/d" $RCLOCAL sed -i "/iptables -I FORWARD -s 10.8.0.0\/24 -j ACCEPT/d" $RCLOCAL sed -i "/iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT/d" $RCLOCAL @@ -290,7 +290,7 @@ crl-verify /etc/openvpn/easy-rsa/pki/crl.pem" >> /etc/openvpn/server.conf firewall-cmd --permanent --zone=public --add-port=$PORT/udp firewall-cmd --permanent --zone=trusted --add-source=10.8.0.0/24 fi - if iptables -L | grep -q REJECT; then + if iptables -L | grep -qE 'REJECT|DROP'; then # If iptables has at least one REJECT rule, we asume this is needed. # Not the best approach but I can't think of other and this shouldn't # cause problems.