From 7d825f36c9ebcfbcfd01d1b1499276258bf4a969 Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 17 Aug 2024 22:56:04 +0200 Subject: [PATCH] Rewrote prune prompt logic, wont prompt if none-interactive flags are used --- dockcheck.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dockcheck.sh b/dockcheck.sh index 0ea7c73..67a7fab 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERSION="v0.4.7" -### ChangeNotes: Notification template changes for: gotify(new), DSM(improved), SMTP(deprecation alternative). +VERSION="v0.4.8" +### ChangeNotes: Rewrote prune to not prompt (default no) if -a|-y or -n flags are used. -p will still autoprune. Github="https://github.com/mag37/dockcheck" RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh" @@ -333,7 +333,7 @@ if [ -n "$GotUpdates" ] ; then fi done printf "\n%bAll done!%b\n" "$c_green" "$c_reset" - [[ -z "$AutoPrune" ]] && read -r -p "Would you like to prune dangling images? y/[n]: " AutoPrune + if [[ -z "$AutoPrune" ]] && [[ -z "$AutoUp" ]]; then read -r -p "Would you like to prune dangling images? y/[n]: " AutoPrune ; fi [[ "$AutoPrune" =~ [yY] ]] && docker image prune -f else printf "\nNo updates installed, exiting.\n"