firewall code deduplication

This commit is contained in:
bolvan
2019-05-15 22:58:24 +03:00
parent c5c55e5419
commit 11b839c43c
2 changed files with 97 additions and 143 deletions

View File

@@ -167,7 +167,7 @@ __fw_tpws6()
done
network_get_device DEVICE lan
dnat6_target
[ "$DNAT6_TARGET" != '-' ] && {
[ "$DNAT6_TARGET" != "-" ] && {
ipt6 PREROUTING -t nat -i $DEVICE $IPT_FILTER_HTTP -j DNAT --to [$DNAT6_TARGET]:$TPPORT_HTTP
[ "$1" != "1" ] || ipt6 PREROUTING -t nat -i $DEVICE $IPT_FILTER_HTTPS -j DNAT --to [$DNAT6_TARGET]:$TPPORT_HTTPS
}