From 0c3500f5ffc10cbcfce667ee8acabbe53efc1ddf Mon Sep 17 00:00:00 2001 From: andryyy Date: Mon, 18 Oct 2021 11:42:09 +0200 Subject: [PATCH] [Update] Make some pathes more fail-safe and minor wording changes --- update.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/update.sh b/update.sh index cc8357e6..1bbc1c5b 100755 --- a/update.sh +++ b/update.sh @@ -46,7 +46,7 @@ done export LC_ALL=C DATE=$(date +%Y-%m-%d_%H_%M_%S) -BRANCH=$(git rev-parse --abbrev-ref HEAD) +BRANCH=$(cd ${SCRIPT_DIR}; git rev-parse --abbrev-ref HEAD) check_online_status() { CHECK_ONLINE_IPS=(1.1.1.1 9.9.9.9 8.8.8.8) @@ -79,7 +79,7 @@ prefetch_images() { docker_garbage() { IMGS_TO_DELETE=() - for container in $(grep -oP "image: \Kmailcow.+" docker-compose.yml); do + for container in $(grep -oP "image: \Kmailcow.+" "${SCRIPT_DIR}/docker-compose.yml"); do REPOSITORY=${container/:*} TAG=${container/*:} V_MAIN=${container/*.} @@ -121,9 +121,9 @@ docker_garbage() { echo "Running image removal without extra confirmation due to force mode." docker rmi ${IMGS_TO_DELETE[*]} fi + echo -e "\e[32mFurther cleanup...\e[0m" + echo "If you want to cleanup further garbage collected by Docker, please make sure all containers are up and running before cleaning your system by executing \"docker system prune\"" fi - echo -e "\e[32mFurther cleanup...\e[0m" - echo "If you want to cleanup further garbage collected by Docker, please make sure all containers are up and running before cleaning your system by executing \"docker system prune\"" } in_array() { @@ -232,7 +232,7 @@ while (($#)); do exit 0 ;; -f|--force) - echo -e "\e[32mForcing Update...\e[0m" + echo -e "\e[32mRunning in forced mode...\e[0m" FORCE=y ;; --no-update-compose)