From ba5e88fc47b262aa66c153c9b82ffa0933682e70 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 18 Aug 2013 18:20:38 +0000 Subject: Do timeout handling git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@641 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- tor-exit-ssl-check-many | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tor-exit-ssl-check-many b/tor-exit-ssl-check-many index 69dac4a..ea8986d 100755 --- a/tor-exit-ssl-check-many +++ b/tor-exit-ssl-check-many @@ -109,8 +109,8 @@ run_some_checks() { sort -R | \ head -n "$PER_RUN" | \ while read fpr; do - [ "$VERBOSE" = 0 ] || echo -n "Checking $host at $fpr..." - if tor-exit-ssl-check -c "$CACHEDIR" -C "$CONTROLSOCKET" "$fpr" $host > "$DUMPFILE" 2>&1; then + [ "$VERBOSE" = 0 ] || echo -n "[$(TZ=UTC date +%Y-%m-%dT%H:%M:%SZ)] Checking $host at $fpr..." + if timeout 600 tor-exit-ssl-check -c "$CACHEDIR" -C "$CONTROLSOCKET" "$fpr" $host > "$DUMPFILE" 2>&1; then ecode=0 else ecode="$?" @@ -133,6 +133,7 @@ run_some_checks() { (echo "Log file at $lf:"; echo; cat "$lf") | mail -s "certificate mismatch found for relay $fpr" "$USER" fi ;; + 124) echo "$prefix timeout!" >> "$LOG";; *) echo "$prefix unknown exit code" >> "$LOG" echo "$prefix unknown exit code" >&2 -- cgit v1.2.3