From 0117374d89a3291c5b43d7c737f1a3c6356e022d Mon Sep 17 00:00:00 2001 From: bol-van Date: Mon, 29 Jul 2024 21:42:12 +0300 Subject: [PATCH] blockcheck: catch HUP to safely handle terminal disconnect --- blockcheck.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blockcheck.sh b/blockcheck.sh index 856bead..6ff86f0 100755 --- a/blockcheck.sh +++ b/blockcheck.sh @@ -1773,7 +1773,7 @@ sigint_cleanup() cleanup exit 1 } -sigpipe() +sigsilent() { # must not write anything here to stdout unprepare_all @@ -1795,7 +1795,8 @@ PID= NREPORT= unset WF trap sigint INT -trap sigpipe PIPE +trap sigsilent PIPE +trap sigsilent HUP for dom in $DOMAINS; do for IPV in $IPVS; do configure_ip_version @@ -1809,6 +1810,7 @@ for dom in $DOMAINS; do [ "$ENABLE_HTTP3" = 1 ] && check_domain_http3 $dom done done +trap - HUP trap - PIPE trap - INT