diff options
author | Patrick McHardy <kaber@trash.net> | 2011-06-30 13:35:56 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2011-06-30 13:35:56 +0200 |
commit | 411b390f3ffcd4708a0dfc0f2824a637de511cea (patch) | |
tree | 50645beb44d0a617d17eb15636f149720061e31f /iptables/iptables-apply | |
parent | 3b7a22b44d74b9b05d5e4b0529ebf72c49dcbff5 (diff) | |
parent | 1c9508e1f3f853f33683eb7118e19b193a6c80b7 (diff) |
Merge branch 'master' of git://dev.medozas.de/iptables
Diffstat (limited to 'iptables/iptables-apply')
-rwxr-xr-x | iptables/iptables-apply | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/iptables/iptables-apply b/iptables/iptables-apply index 5fec76b0..86b8d5a2 100755 --- a/iptables/iptables-apply +++ b/iptables/iptables-apply @@ -11,7 +11,6 @@ PROGNAME="${0##*/}"; VERSION=1.0 TIMEOUT=10 -DEFAULT_FILE=/etc/network/iptables function blurb() { @@ -87,6 +86,19 @@ for opt in $OPTS; do shift done +case "$PROGNAME" in + (*6*) + SAVE=ip6tables-save + RESTORE=ip6tables-restore + DEFAULT_FILE=/etc/network/ip6tables + ;; + (*) + SAVE=iptables-save + RESTORE=iptables-restore + DEFAULT_FILE=/etc/network/iptables + ;; +esac + FILE="${1:-$DEFAULT_FILE}"; if [[ -z "$FILE" ]]; then @@ -99,17 +111,6 @@ if [[ ! -r "$FILE" ]]; then exit 2 fi -case "${0##*/}" in - (*6*) - SAVE=ip6tables-save - RESTORE=ip6tables-restore - ;; - (*) - SAVE=iptables-save - RESTORE=iptables-restore - ;; -esac - COMMANDS=(tempfile "$SAVE" "$RESTORE") for cmd in "${COMMANDS[@]}"; do |