Bash script syntax improvements

This commit is contained in:
Roy Lenferink
2019-01-19 13:58:58 +01:00
parent 771baea30e
commit 6df3deb4bc
12 changed files with 128 additions and 128 deletions

View File

@@ -115,14 +115,14 @@ if [ ${remote} = true ] ; then
IFS=',' read -ra IM <<< "${images}"
images=""
for i in "${IM[@]}"; do
if [[ $(gcloud compute instances list "${instance_prefix}-$i" | grep ${i}) ]]; then
if [[ ${hosts} != "" ]]; then
if [[ $(gcloud compute instances list "${instance_prefix}-${i}" | grep ${i}) ]]; then
if [[ "${hosts}" != "" ]]; then
hosts="${hosts},"
fi
echo "Reusing host ${instance_prefix}-$i"
echo "Reusing host ${instance_prefix}-${i}"
hosts="${hosts}${instance_prefix}-${i}"
else
if [[ ${images} != "" ]]; then
if [[ "${images}" != "" ]]; then
images="${images},"
fi
images="${images}${i}"