feat: remove too much verbose

This commit is contained in:
AngeD 2022-08-22 17:23:17 +02:00
parent ce9bf86211
commit c099b69d85

View File

@ -1,10 +1,6 @@
#!/bin/bash #!/bin/bash
NORMAL='\e[0m' NORMAL='\e[0m'
BOLD='\e[1m'
RED='\e[31m'
ECHO='echo -e'
PS="$(docker ps -aq 2> /dev/null)" PS="$(docker ps -aq 2> /dev/null)"
@ -18,10 +14,9 @@ IMG="$(docker images -q 2> /dev/null)"
if [ -n "$PS" ]; then if [ -n "$PS" ]; then
$ECHO "${BOLD}${RED}CONTAINERS${NORMAL}"
docker ps -a docker ps -a
$ECHO -n "Prune Containers? [Y/n/a] " echo -n "Prune Containers? [Y/n/a] "
read -r ANS read -r ANS
case "${ANS,,}" in case "${ANS,,}" in
'y'|'yes'|'') 'y'|'yes'|'')
@ -34,23 +29,23 @@ if [ -n "$PS" ]; then
fi fi
if [ -n "$VOL" ]; then if [ -n "$VOL" ]; then
$ECHO "${BOLD}${RED}VOLUMES${NORMAL}" echo
docker volume ls docker volume ls
$ECHO -n "Prune Volumes? [Y/n] " echo -n "Prune Volumes? [Ya/n] "
read -r ANS read -r ANS
case "${ANS,,}" in case "${ANS,,}" in
'y'|'yes'|'') 'y'|'yes'|'a'|'all'|'')
echo "$VOL" | xargs docker volume rm -f 2> /dev/null echo "$VOL" | xargs docker volume rm -f 2> /dev/null
;; ;;
esac esac
fi fi
if [ -n "$IMG" ]; then if [ -n "$IMG" ]; then
$ECHO "${BOLD}${RED}IMAGES${NORMAL}" echo
docker images docker images
$ECHO -n "Prune Images? [Y/n/a] " echo -n "Prune Images? [Y/n/a] "
read -r ANS read -r ANS
case "${ANS,,}" in case "${ANS,,}" in
'y'|'yes'|'') 'y'|'yes'|'')