From: Peter Palfrader Date: Thu, 25 Apr 2013 12:36:03 +0000 (+0200) Subject: Fix awk variable assignments X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=49428e397bab9eb9ccc420a3195cdb69b5bee86b;p=mirror%2Fdsa-puppet.git Fix awk variable assignments --- diff --git a/modules/roles/files/static-mirroring/static-master-ssh-wrap b/modules/roles/files/static-mirroring/static-master-ssh-wrap index 8387560b0..da162159a 100755 --- a/modules/roles/files/static-mirroring/static-master-ssh-wrap +++ b/modules/roles/files/static-mirroring/static-master-ssh-wrap @@ -102,7 +102,7 @@ do_update_component() { shift hit="$( - awk -v this_host="$(hostname -f)" component="$component" -v host="$remote_host" ' + awk -v this_host="$(hostname -f)" -v component="$component" -v host="$remote_host" ' $1 == this_host && $2 == component { if ($3 == host) { print $4 diff --git a/modules/roles/files/static-mirroring/static-master-update-component b/modules/roles/files/static-mirroring/static-master-update-component index 82bae0d81..e01c7343d 100755 --- a/modules/roles/files/static-mirroring/static-master-update-component +++ b/modules/roles/files/static-mirroring/static-master-update-component @@ -81,8 +81,8 @@ if [ "${component%/*}" != "$component" ] ; then exit 1 fi -srchost="$(awk -v this_host="$(hostname -f)" component="$component" '$1 == this_host && $2 == component {print $3; exit}' "$componentlist")" -srcdir="$(awk -v this_host="$(hostname -f)" component="$component" '$1 == this_host && $2 == component {print $4; exit}' "$componentlist")" +srchost="$(awk -v this_host="$(hostname -f)" -v component="$component" '$1 == this_host && $2 == component {print $3; exit}' "$componentlist")" +srcdir="$(awk -v this_host="$(hostname -f)" -v component="$component" '$1 == this_host && $2 == component {print $4; exit}' "$componentlist")" if [ -z "$srchost" ] || [ -z "$srcdir" ]; then echo >&2 "$0: Invalid component: $component (not found in $componentlist)"; exit 1