From 9bc95a1e551e007481922aea7701314e95c7ae72 Mon Sep 17 00:00:00 2001 From: Jarell <91372088+jarelllama@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:04:42 +0800 Subject: [PATCH] Fix --- functions/retrieve_domains.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/functions/retrieve_domains.sh b/functions/retrieve_domains.sh index 483032786..eb1f642f5 100644 --- a/functions/retrieve_domains.sh +++ b/functions/retrieve_domains.sh @@ -199,7 +199,7 @@ build() { # Exit if no new domains to add if ! grep -q '[a-z]' retrieved_domains.tmp; then printf "\n\e[1mNo new domains to add.\e[0m\n" - exit 0 + decide_exit fi format_file retrieved_domains.tmp @@ -239,10 +239,18 @@ build() { # Add updated logs printf "%s\n%s\n" "$temp_source_log" "$rows" > "$SOURCE_LOG" + decide_exit +} + +# Function 'decide_error' checks if the script should exit with an +# exit status of 1 or 0. +decide_exit() { # Exit with error if domains need to be manually reviewed if [[ -f manual_review.tmp ]]; then printf "\n" exit 1 + else + exit 0 fi }