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
This commit is contained in:
parent
2309683438
commit
3d3a8c0d5d
@ -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; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user