X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fgeodns%2Ffiles%2Fcommon%2Frecvconf;h=05419c9096d98a45e134fc5f8c20727f48bb5303;hb=2f0cdbb3c69400e04c769e9efaa34fa8940267a2;hp=4096d656cff87f87431a52e144a313d9e605faf0;hpb=2d49f48b072cb1be030826b050e424470485fad7;p=mirror%2Fdsa-puppet.git diff --git a/modules/geodns/files/common/recvconf b/modules/geodns/files/common/recvconf index 4096d656c..05419c909 100755 --- a/modules/geodns/files/common/recvconf +++ b/modules/geodns/files/common/recvconf @@ -1,15 +1,29 @@ #!/bin/bash +# +# THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +# USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git +# + set -e +set -u ## Copyright (c) 2005 David B. Harris -## Copyright (c) 2005 Peter Palfrader +## Copyright (c) 2005,2009 Peter Palfrader ## This text is released under the "three-clause BSD license". ## The full text of the license is available at the end of this file. +if [ "$#" != 1 ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +FILELIST="$1" + printf "\nrecvconf on %s processing:\n" "$(hostname -s)" -FILELIST=/etc/NOREPLY/recvconf.files + +umask 077 temptar="$(mktemp)" chmod 0600 "$temptar" @@ -85,7 +99,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))" @@ -111,7 +132,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