From 8848e192c647d4699f0fbaea578b312ed93c5229 Mon Sep 17 00:00:00 2001 From: AustrianToast Date: Wed, 11 Dec 2024 20:43:50 +0100 Subject: [PATCH] fix if statements --- add_and_download_url.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/add_and_download_url.sh b/add_and_download_url.sh index 95ea947..80e2249 100755 --- a/add_and_download_url.sh +++ b/add_and_download_url.sh @@ -31,12 +31,12 @@ echo "command: gallery-dl --config ./gallery-dl/config.json --directory $path $u for ((n=0;n<5;n++)); do gallery-dl --config ./gallery-dl/config.json --directory "$path" "$url" - [[ $(echo $?) -eq 0 ]] && (echo -e "${IGREEN}Success${NO_COLOR}"; break) + [[ $(echo $?) -eq 0 ]] && echo -e "${IGREEN}Success${NO_COLOR}" && exit 0 echo -e "${IYELLOW}download failed${NO_COLOR}" - [[ $(ping -c 3 v4.ip.hopeless-cloud.xyz > /dev/null 2>&1) -ne 0 ]] && (echo -e "${IRED}no internet${NO_COLOR}"; exit 1) - [[ $(ping -c 3 v6.ip.hopeless-cloud.xyz > /dev/null 2>&1) -ne 0 ]] && (echo -e "${IRED}no internet${NO_COLOR}"; exit 1) + [[ $(ping -c 3 v4.ip.hopeless-cloud.xyz > /dev/null 2>&1) -ne 0 ]] && echo -e "${IRED}no internet${NO_COLOR}" && exit 1 + [[ $(ping -c 3 v6.ip.hopeless-cloud.xyz > /dev/null 2>&1) -ne 0 ]] && echo -e "${IRED}no internet${NO_COLOR}" && exit 1 echo -e "${IGREEN}has internet${NO_COLOR}" done