package/iptables: S35iptables script cleanups

This patch removes unneeded redirections when
calling iptables-restore and iptables-save, and
it adds the save operation to the usage help.

Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
José Pekkarinen 2021-10-06 09:20:31 +03:00 committed by Peter Korsgaard
parent c424eb25ca
commit 0a05655705

View File

@ -6,7 +6,7 @@ IPTABLES_ARGS=""
start() {
printf 'Starting %s: ' "$DAEMON"
iptables-restore < /etc/iptables.conf
iptables-restore /etc/iptables.conf
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
@ -36,7 +36,7 @@ restart() {
save() {
printf 'Saving %s: ' "$DAEMON"
iptables-save > /etc/iptables.conf
iptables-save -f /etc/iptables.conf
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
@ -53,6 +53,6 @@ case "$1" in
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
echo "Usage: $0 {start|stop|restart|save|reload}"
exit 1
esac