]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Fix awk variable assignments
authorPeter Palfrader <peter@palfrader.org>
Thu, 25 Apr 2013 12:36:03 +0000 (14:36 +0200)
committerPeter Palfrader <peter@palfrader.org>
Thu, 25 Apr 2013 12:36:03 +0000 (14:36 +0200)
modules/roles/files/static-mirroring/static-master-ssh-wrap
modules/roles/files/static-mirroring/static-master-update-component

index 8387560b0f38863e976d800f9b2d0643179763e5..da162159ac51d4935c03228012b0cbb3f1120524 100755 (executable)
@@ -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
index 82bae0d81041f67791993553cff09b2f14b84ce3..e01c7343d3fbff995e6113649781859f40f1ace2 100755 (executable)
@@ -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