Correct 'save_dynamic_chains'

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-02-20 09:57:11 -08:00
parent 663f82c158
commit 4306ff1029

View File

@ -8082,25 +8082,22 @@ else
rm -f \${VARDIR}/.dynamic rm -f \${VARDIR}/.dynamic
fi fi
EOF EOF
} else { } else {
$tool = $family == F_IPV4 ? '${IPTABLES}-save' : '${IP6TABLES}-save';
emit <<"EOF"; emit <<"EOF";
if chain_exists 'UPnP -t nat'; then if chain_exists 'UPnP -t nat'; then
$tool -t nat | grep '^-A UPnP ' > \${VARDIR}/.UPnP $utility -t nat | grep '^-A UPnP ' > \${VARDIR}/.UPnP
else else
rm -f \${VARDIR}/.UPnP rm -f \${VARDIR}/.UPnP
fi fi
if chain_exists forwardUPnP; then if chain_exists forwardUPnP; then
$tool -t filter | grep '^-A forwardUPnP ' > \${VARDIR}/.forwardUPnP $utility -t filter | grep '^-A forwardUPnP ' > \${VARDIR}/.forwardUPnP
else else
rm -f \${VARDIR}/.forwardUPnP rm -f \${VARDIR}/.forwardUPnP
fi fi
if chain_exists dynamic; then if chain_exists dynamic; then
$tool -t filter | grep '^-A dynamic ' > \${VARDIR}/.dynamic $utility -t filter | grep '^-A dynamic ' > \${VARDIR}/.dynamic
else else
rm -f \${VARDIR}/.dynamic rm -f \${VARDIR}/.dynamic
fi fi
@ -8123,7 +8120,7 @@ EOF
} else { } else {
emit( qq(if [ "\$COMMAND" = stop -o "\$COMMAND" = clear ]; then), emit( qq(if [ "\$COMMAND" = stop -o "\$COMMAND" = clear ]; then),
qq( if chain_exists dynamic; then), qq( if chain_exists dynamic; then),
qq( $tool -t filter | grep '^-A dynamic ' > \${VARDIR}/.dynamic) ); qq( $utility -t filter | grep '^-A dynamic ' > \${VARDIR}/.dynamic) );
} }
emit <<"EOF"; emit <<"EOF";