From 3d3a8c0d5d444928cb11a645e8fc4f04b8141331 Mon Sep 17 00:00:00 2001 From: Dave Wilde Date: Wed, 7 Sep 2016 11:15:07 -0500 Subject: [PATCH] Add test to ensure that directories are not empty The scp command will fail if the directory in the preceeding for loop is empty. This adds a test to ensure that $i is acutally a file name. Change-Id: Ib2a3c929a7a15b290c2cf09c05d4079a1ec8c6e6 Closes-Bug: #1621160 --- multi-node-aio/deploy-vms.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multi-node-aio/deploy-vms.sh b/multi-node-aio/deploy-vms.sh index 1b1a496e..d8465ed2 100755 --- a/multi-node-aio/deploy-vms.sh +++ b/multi-node-aio/deploy-vms.sh @@ -58,7 +58,9 @@ done for node in $(get_all_hosts); do ssh -q -n -f -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "mkdir -p /tmp/keys" for i in /etc/apt/apt.conf.d/00-nokey /etc/apt/sources.list /etc/apt/sources.list.d/* /tmp/keys/*; do - scp "$i" "10.0.0.${node#*":"}:$i" + if [[ -f "$i" ]]; then + scp "$i" "10.0.0.${node#*":"}:$i" + fi done ssh -q -n -f -o StrictHostKeyChecking=no 10.0.0.${node#*":"} "(for i in /tmp/keys/*; do \ apt-key add \$i; \