diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-04-12 10:21:31 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-04-12 10:21:31 +0000 |
commit | a6f9e90cca8610a5e7627d4494905264dd8b73fb (patch) | |
tree | e5ea12157dbe840c466c48ae1f54c6e78c58fb73 /tcwg-cleanup-stale-containers.sh | |
parent | 08fc0cceeade1f5f20f9211e0ea9745656641fb5 (diff) |
tcwg-cleanup-stale-containers.sh: Fix typos.
Change-Id: I49fd34eb85acabd916e61f5eb7f95a3e4398f4fd
Diffstat (limited to 'tcwg-cleanup-stale-containers.sh')
-rwxr-xr-x | tcwg-cleanup-stale-containers.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tcwg-cleanup-stale-containers.sh b/tcwg-cleanup-stale-containers.sh index b05f220b..724eedb2 100755 --- a/tcwg-cleanup-stale-containers.sh +++ b/tcwg-cleanup-stale-containers.sh @@ -5,16 +5,16 @@ set -e docker_ps_opts="" hours="10" verbose=false -clean_containers=false -clean_volumes=false -clean_images=false +cleanup_containers=false +cleanup_volumes=false +cleanup_images=false -OPTS="`getopt -l clean-containers:,clean-images:,clean-volumes:,docker_ps_opts:,hours:,verbose: -- "$@"`" +OPTS="`getopt -l cleanup-containers:,cleanup-images:,cleanup-volumes:,docker_ps_opts:,hours:,verbose: -- "$@"`" while test $# -gt 1; do case $1 in - --clean-containters) clean_containers="$2"; shift ;; - --clean-images) clean_images="$2"; shift ;; - --clean-volumes) clean_volumes="$2"; shift ;; + --cleanup-containters) cleanup_containers="$2"; shift ;; + --cleanup-images) cleanup_images="$2"; shift ;; + --cleanup-volumes) cleanup_volumes="$2"; shift ;; --docker_ps_opts) docker_ps_opts="$2"; shift ;; --hours) hours="$2"; shift ;; --verbose) verbose="$2"; shift ;; @@ -53,7 +53,7 @@ if [ ${#rm_containers[@]} != 0 ]; then echo "Removing containers: ${rm_containers[@]}" echo "Increasing exit code by 1 to indicate stale containers" status="$(($status+1))" - if $clean_containers; then + if $cleanup_containers; then for container in "${rm_containers[@]}"; do echo "Removing container $container" docker rm -f -v $container | cat @@ -71,7 +71,7 @@ if [ x"$(docker volume ls -q -f dangling=true)" != x"" ]; then echo "Removing dangling volumes" echo "Increasing exit code by 2 to indicate dangling volumes" status="$(($status+2))" - if $clean_volumes; then + if $cleanup_volumes; then docker volume ls -q -f dangling=true | xargs docker volume rm | cat echo "xargs docker volume rm exit status: ${PIPESTATUS[1]}" else @@ -90,7 +90,7 @@ if [ ${#rm_images[@]} != 0 ]; then echo "Removing unused images" echo "Increasing exit code by 4 to indicate unused images" status="$(($status+4))" - if $clean_images; then + if $cleanup_images; then for image in "${rm_images[@]}"; do docker rmi $image | cat echo "docker rmi exit status: ${PIPESTATUS[0]}" |