diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-02-19 11:32:33 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-02-19 11:32:33 -0500 |
commit | af36af1a9b857772fb6dac2b413850ce8e02bdee (patch) | |
tree | 60237d20a395940139699af2a70a572631e7a029 /contrib | |
parent | 1239e411a767e39905edbf95acc09284f161a0ea (diff) | |
parent | 4e3880607ad2f09711e18429afda1514a2cb7e28 (diff) | |
download | tor-af36af1a9b857772fb6dac2b413850ce8e02bdee.tar.gz tor-af36af1a9b857772fb6dac2b413850ce8e02bdee.zip |
Merge remote-tracking branch 'tor-github/pr/683'
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/dirauth-tools/nagios-check-tor-authority-cert | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/dirauth-tools/nagios-check-tor-authority-cert b/contrib/dirauth-tools/nagios-check-tor-authority-cert index 46dc7284b7..75ff479a53 100755 --- a/contrib/dirauth-tools/nagios-check-tor-authority-cert +++ b/contrib/dirauth-tools/nagios-check-tor-authority-cert @@ -49,12 +49,12 @@ DIRSERVERS="$DIRSERVERS 80.190.246.100:80" # gabelmoo DIRSERVERS="$DIRSERVERS 194.109.206.212:80" # dizum DIRSERVERS="$DIRSERVERS 213.73.91.31:80" # dannenberg -TMPFILE="`tempfile`" +TMPFILE=$(mktemp) trap 'rm -f "$TMPFILE"' 0 for dirserver in $DIRSERVERS; do - wget -q -O "$TMPFILE" "http://$dirserver/tor/keys/fp/$identity" - if [ "$?" = 0 ]; then + if wget -q -O "$TMPFILE" "http://$dirserver/tor/keys/fp/$identity" + then break else cat /dev/null > "$TMPFILE" @@ -74,10 +74,10 @@ now=$(date +%s) if [ "$now" -ge "$expiryunix" ]; then echo "CRITICAL: Certificate expired $expirydate (authority $identity)." exit 2 -elif [ "$(( $now + 7*24*60*60 ))" -ge "$expiryunix" ]; then +elif [ "$(( now + 7*24*60*60 ))" -ge "$expiryunix" ]; then echo "CRITICAL: Certificate expires $expirydate (authority $identity)." exit 2 -elif [ "$(( $now + 30*24*60*60 ))" -ge "$expiryunix" ]; then +elif [ "$(( now + 30*24*60*60 ))" -ge "$expiryunix" ]; then echo "WARNING: Certificate expires $expirydate (authority $identity)." exit 1 else |