From d1f14bc62b04178b6ec29f5e7d37d9f708560535 Mon Sep 17 00:00:00 2001 From: andryyy Date: Mon, 31 Jul 2017 08:56:14 +0200 Subject: [PATCH] [Update.sh] Test if var is int --- update.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/update.sh b/update.sh index 998dc32b..b0fc9766 100755 --- a/update.sh +++ b/update.sh @@ -149,6 +149,11 @@ for container in $(grep -oP "image: \Kmailcow.+" docker-compose.yml); do for existing_tag in ${EXISTING_TAGS[@]}; do V_MAIN_EXISTING=${existing_tag/*.} V_SUB_EXISTING=${existing_tag/*.} + + # Not an integer + [[ ! $V_MAIN_EXISTING =~ ^[0-9]+$ ]] && continue + [[ ! $V_SUB_EXISTING =~ ^[0-9]+$ ]] && continue + if [[ $V_MAIN_EXISTING == "latest" ]]; then echo "Found deprecated label \"latest\" for repository $REPOSITORY, it should be deleted." IMGS_TO_DELETE+=($REPOSITORY:$existing_tag)