]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Make it work with set -u
authorPeter Palfrader <peter@palfrader.org>
Wed, 27 May 2009 19:29:27 +0000 (21:29 +0200)
committerPeter Palfrader <peter@palfrader.org>
Wed, 27 May 2009 19:29:27 +0000 (21:29 +0200)
modules/geodns/files/common/recvconf

index 36f957343a80569618b621f7e1fd795defb2950e..e124e7139cc86819a85c41ef73610cf316759394 100755 (executable)
@@ -94,7 +94,14 @@ copy_and_runcommands() {
 
 IN=0
 linenum=0
+file=""
 nextfile=""
+
+clear_vars() {
+       perms=""; user=""; group=""; precommand=""; postcommand=""
+}
+clear_vars
+
 while read line; do
     linenum="$(($linenum + 1))"
 
@@ -120,7 +127,7 @@ while read line; do
        ## the file, then set a $file to the new value and continue parsing.
        [ -n "$file" ] && copy_and_runcommands "$file" "$perms" "$user" "$group" "$precommand" "$postcommand"
        file="$(printf "%s" "$line" | sed -e 's/[[:space:]]*file[[:space:]]\+\([^[:space:]#]*\).*/\1/')"
-       perms=""; user=""; group=""; precommand=""; postcommand=""
+       clear_vars
        continue
     fi