diff --git a/firewall/firewall-add b/firewall/firewall-add index d35f7c6..7c6fa1e 100755 --- a/firewall/firewall-add +++ b/firewall/firewall-add @@ -28,6 +28,9 @@ EXTRA_OPTIONS="$2 $3 $4" fi; +if [[ -z "$TYPE" ]]; then + TYPE="tcp" +fi; if [[ -z "$SOURCE_IP" ]]; then SOURCE_IP="0.0.0.0/0" fi; @@ -158,12 +161,14 @@ else if [ -n "$LINES" ] ; then for i in $LINES; do + debug "$IPTABLES -D $CHAIN $i" $IPTABLES -D $CHAIN $i sleep 0.1 done fi - $IPTABLES -I $CHAIN -s $SOURCE_IP --sport $SOURCE_PORT -d $TARGET_IP -p $PROTOCOL --dport $TARGET_PORT -m comment --comment "$COMMENT" -j ACCEPT + debug "$IPTABLES -I $CHAIN -p $PROTOCOL -s $SOURCE_IP --sport $SOURCE_PORT -d $TARGET_IP --dport $TARGET_PORT -m comment --comment "$COMMENT" -j ACCEPT" + $IPTABLES -I $CHAIN -p $PROTOCOL -s $SOURCE_IP --sport $SOURCE_PORT -d $TARGET_IP --dport $TARGET_PORT -m comment --comment "$COMMENT" -j ACCEPT ############################# fi