From 0eccb0dd4dee9c5e6d2d376f5de837e40418a5e6 Mon Sep 17 00:00:00 2001 From: Guido Diepen Date: Tue, 25 Apr 2017 10:09:58 +0200 Subject: [PATCH] Remove not needed indentation on output lines --- docker_get_data_volume_info.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docker_get_data_volume_info.sh b/docker_get_data_volume_info.sh index dff35e4..9cc9445 100644 --- a/docker_get_data_volume_info.sh +++ b/docker_get_data_volume_info.sh @@ -2,27 +2,29 @@ echo "List of all volumes:" +echo + for docker_volume_id in $(docker volume ls -q) do - echo " (Un)named volume: ${docker_volume_id}" + echo "(Un)named volume: ${docker_volume_id}" docker_volume_size=$(docker run --rm -t -v ${docker_volume_id}:/volume_data ubuntu bash -c "du -hs /volume_data | cut -f1" ) - echo " Size: ${docker_volume_size}" + echo " Size: ${docker_volume_size}" num_related_containers=$(docker ps -a --filter=volume=${docker_volume_id} -q | wc -l) if (( $num_related_containers > 0 )) then - echo " Connected containers:" + echo " Connected containers:" docker ps -a --filter=volume=${docker_volume_id} --format "{{.Names}} [{{.Image}}] ({{.Status}})" | while read containerDetails do - echo " ${containerDetails}" + echo " ${containerDetails}" done else - echo " No connected containers" + echo " No connected containers" fi echo