diff options
author | David Spickett <david.spickett@linaro.org> | 2020-04-23 11:10:08 +0100 |
---|---|---|
committer | David Spickett <david.spickett@linaro.org> | 2020-04-28 13:13:46 +0000 |
commit | 6273fc478b9c95c4ae8d42c9021f9428b1d43811 (patch) | |
tree | 9564b82cc9e90dc4886835d30cbdea35453b1f53 /tcwg-cleanup-stale-containers.sh | |
parent | 0ce72e970e6cbb6c39469b503cdf65510f4f99d8 (diff) |
Shellcheck fixes round 3
Now using the version that's
present in the bionic images.
Meaning we have more warnings
but can also set the minimum
level to ignore a lot of them.
Fix the check for whether
shellcheck supports --severity.
(we have pipefail on, but we
expect shellcheck to fail in
this case)
Change-Id: I296b8554591b7d327c75393e3924184abc6512b7
Diffstat (limited to 'tcwg-cleanup-stale-containers.sh')
-rwxr-xr-x | tcwg-cleanup-stale-containers.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tcwg-cleanup-stale-containers.sh b/tcwg-cleanup-stale-containers.sh index a0a56943..2b1a87c8 100755 --- a/tcwg-cleanup-stale-containers.sh +++ b/tcwg-cleanup-stale-containers.sh @@ -109,7 +109,7 @@ do_cleanup_containers () ;; esac fi - rm_containers=("${rm_containers[@]}" $container) + rm_containers=("${rm_containers[@]}" "$container") fi done @@ -210,7 +210,7 @@ fi # Check if we have more containers than max_containers nb_containers=$($DOCKER ps -a | wc -l) -if [ ${max_containers} -gt 0 -a ${nb_containers} -gt ${max_containers} ]; then +if [ ${max_containers} -gt 0 ] && [ ${nb_containers} -gt ${max_containers} ]; then echo "ERROR: Too many containers left after cleanup: ${nb_containers} (max: ${max_containers})" status=$(($status|32)) fi |