From d2b86f9ba8e3c99e4e0e053fd2c8a4310070552f Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 27 May 2009 21:29:27 +0200 Subject: [PATCH] Make it work with set -u --- modules/geodns/files/common/recvconf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/geodns/files/common/recvconf b/modules/geodns/files/common/recvconf index 36f957343..e124e7139 100755 --- a/modules/geodns/files/common/recvconf +++ b/modules/geodns/files/common/recvconf @@ -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 -- 2.20.1