From 8cb881c7bb5450072a823b5ec3bb756941d6ecc0 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Sun, 6 Mar 2022 10:55:41 +0100 Subject: [PATCH] Update Checker: Link Status --- var/lib/gsl/scripts/gsl__post_checkers | 43 ++++++++++++-------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/var/lib/gsl/scripts/gsl__post_checkers b/var/lib/gsl/scripts/gsl__post_checkers index bf69a96..fd814dd 100644 --- a/var/lib/gsl/scripts/gsl__post_checkers +++ b/var/lib/gsl/scripts/gsl__post_checkers @@ -209,29 +209,26 @@ if (( "$gsl_count_links" > 0 ));then '%{http_code}' \ "$gsl_post_hf_2" 2>/dev/null` - if (( $gsl_url_status == 200 )) || \ - (( $gsl_url_status == 301 )) || \ - (( $gsl_url_status == 302 ));then - - gsl__logs_print \ - "$gsl_log_i" \ - "Post" \ - "$gsl_log_h_link" \ - "Online:$gsl_url_status ${gsl_post_hf_2:0:40}..." \ - "${PWD}/$gsl_post" - - else - - gsl__logs_print \ - "$gsl_log_e" \ - "Post" \ - "$gsl_log_h_link" \ - "Offline:$gsl_url_status ${gsl_post_hf_2:0:40}..." \ - "${PWD}/$gsl_post" - gsl_checker_err=true - return - - fi + case "$gsl_url_status" in + 1*|2*|3*) + gsl__logs_print \ + "$gsl_log_i" \ + "Post" \ + "$gsl_log_h_link" \ + "Online:$gsl_url_status ${gsl_post_hf_2:0:40}..." \ + "${PWD}/$gsl_post" + ;; + ""|*) + gsl__logs_print \ + "$gsl_log_e" \ + "Post" \ + "$gsl_log_h_link" \ + "Offline:$gsl_url_status ${gsl_post_hf_2:0:40}..." \ + "${PWD}/$gsl_post" + gsl_checker_err=true + return + ;; + esac # Stats ((gsl_stat_link++))