From 17dda2504dd01c7b48ba8919866615b0b74b52bb Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 14 Mar 2020 17:44:20 -0600 Subject: [PATCH] use 'force' on all docker related removals --- ab-openldap/ab-openldap.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ab-openldap/ab-openldap.sh b/ab-openldap/ab-openldap.sh index 579e307..e26c303 100755 --- a/ab-openldap/ab-openldap.sh +++ b/ab-openldap/ab-openldap.sh @@ -243,7 +243,7 @@ if [ $clean = true ]; then volumes=$(docker inspect --format '{{ range .Mounts }}{{ println .Name }}{{ end }}' ${container}) # remove container printf "\t%sRemoving container...%s\n" "$red" "$norm" - docker rm ${container} > /dev/null 2>&1 + docker rm -f ${container} > /dev/null 2>&1 # pause to allow write flushing sleep 3 # iterate volumes @@ -251,7 +251,7 @@ if [ $clean = true ]; then shift for volume; do printf "\t%sRemoving volume '%s'...%s\n" "$red" "$volume" "$norm" - docker volume rm ${volume} > /dev/null 2>&1 + docker volume rm -f ${volume} > /dev/null 2>&1 done printf "%s...done%s\n" "$cyan" "$norm" done @@ -265,8 +265,8 @@ elif [ $restore = true ]; then prompt_yn # delete any conflicting volumes - docker volume rm ${volume_data} > /dev/null 2>&1 - docker volume rm ${volume_ldif} > /dev/null 2>&1 + docker volume rm -f ${volume_data} > /dev/null 2>&1 + docker volume rm -f ${volume_ldif} > /dev/null 2>&1 # run temporary container to merge backup data into volumes docker run --rm \ -v "$volume_data":/var/openldap/data \