I agree. I think the following is a better patch though:

--- /usr/sbin/iptables-apply    2009-06-16 16:37:44.000000000 +0200
+++ /tmp/iptables-apply 2009-09-22 21:02:59.000000000 +0200
@@ -11,7 +11,6 @@
 VERSION=1.0
 
 TIMEOUT=10
-DEFAULT_FILE=/etc/network/iptables
 
 function blurb()
 {
@@ -87,6 +86,19 @@
        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/ip6tables
+               ;;
+esac
+
 FILE="${1:-$DEFAULT_FILE}";
 
 if [[ -z "$FILE" ]]; then
@@ -99,17 +111,6 @@
        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 "${comman...@]}"; do

-- 
 .''`.   martin f. krafft <[email protected]>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
"lessing was a heretics' heretic"
                                                    -- walter kaufmann

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)

Reply via email to