summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2013-08-18 18:20:38 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2013-08-18 18:20:38 +0000
commitba5e88fc47b262aa66c153c9b82ffa0933682e70 (patch)
tree593d29131232ce98db6b64eee737bd25f11f2494
parent4fb3df8a94f20b6ea2c200ee52d3a20e4199eb27 (diff)
Do timeout handling
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@641 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xtor-exit-ssl-check-many5
1 files 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