From e39ea0748f7dc3c3e7f25b8f1228ca7be6b887b6 Mon Sep 17 00:00:00 2001 From: mag37 Date: Tue, 19 Dec 2023 22:52:11 +0100 Subject: [PATCH] Update dockcheck.sh Added -m, Monochrome Mode. --- dockcheck.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dockcheck.sh b/dockcheck.sh index 3135171..c7730ab 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -27,6 +27,7 @@ Help() { echo "-d N Only update to new images that are N+ days old. Lists too recent with +prefix and age. 2xSlower." echo "-p Auto-Prune dangling images after update." echo "-r Allow updating images for docker run, wont update the container" + echo "-m Monochrome mode, no printf color codes." echo "-s Include stopped containers in the check. (Logic: docker ps -a)" } @@ -40,13 +41,14 @@ c_reset="\033[0m" Stopped="" -while getopts "aynprhse:d:" options; do +while getopts "aynprhsme:d:" options; do case "${options}" in a|y) UpdYes="yes" ;; n) UpdYes="no" ;; r) DrUp="yes" ;; p) PruneQ="yes" ;; e) Exclude=${OPTARG} ;; + m) declare c_{red,green,yellow,blue,teal,reset}="" ;; s) Stopped="-a" ;; d) DaysOld=${OPTARG} if ! [[ $DaysOld =~ ^[0-9]+$ ]] ; then { printf "Days -d argument given (%s) is not a number.\n" "${DaysOld}" ; exit 2 ; } ; fi ;;