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