From ae1c4d255d70f455c66c64e0f1b4f611d6c3c257 Mon Sep 17 00:00:00 2001 From: gyurix Date: Mon, 12 Sep 2022 13:00:57 +0000 Subject: [PATCH] validating application names or IP addresses variables --- firewall/firewall-add | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firewall/firewall-add b/firewall/firewall-add index 3148585..17e17bd 100755 --- a/firewall/firewall-add +++ b/firewall/firewall-add @@ -322,10 +322,13 @@ else if [ "$TARGET_PORT" != "" ]; then IPTABLES_OPTIONS=$IPTABLES_OPTIONS" --dport $TARGET_PORT"; fi + + if [[ "$SOURCE_IP" != "" && "$TARGET_IP" != "" ]]; then debug "$IPTABLES -I $CHAIN -p $PROTOCOL $IPTABLES_OPTIONS -m comment --comment "$COMMENT" -j ACCEPT" $IPTABLES -I $CHAIN -p $PROTOCOL $IPTABLES_OPTIONS -m comment --comment "$COMMENT" -j ACCEPT - + + fi ############################# fi