From e6ff00f603f8884c32b8c111c9e3e40997aa6251 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 24 Mar 2023 04:53:04 +0100 Subject: [PATCH] Abort gravity when downloading/parsing the files did not succeed Signed-off-by: DL6ER --- gravity.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index a926bacd..68424a28 100755 --- a/gravity.sh +++ b/gravity.sh @@ -544,7 +544,7 @@ gravity_DownloadBlocklists() { # is saved in gravtiy's info table to signal FTL if such domains are available abp_domains=0 parseList() { - local adlistID="${1}" src="${2}" target="${3}" temp_file temp_file_base num_domains num_abp_domains valid_domain_pattern abp_domain_pattern + local adlistID="${1}" src="${2}" target="${3}" temp_file temp_file_base num_abp_domains valid_domain_pattern abp_domain_pattern # Print status message echo -ne " ${INFO} Processing list..." @@ -1009,7 +1009,11 @@ if ! gravity_CheckDNSResolutionAvailable; then exit 1 fi -gravity_DownloadBlocklists +# Download blocklists +if ! gravity_DownloadBlocklists; then + echo -e " ${CROSS} Unable to create database. Please try again later. If the problem persists, please contact support." + exit 1 +fi # Create local.list gravity_generateLocalList