Handle different tor health statuses
This commit is contained in:
parent
dc73d01410
commit
5e8046f637
|
@ -324,7 +324,13 @@ function check_tor_health {
|
|||
echo 'fi';
|
||||
echo 'if [ ! -f /tmp/.torfailed ]; then';
|
||||
echo " tail -n 3 /var/log/tor/notices.log | mail -s \"[${PROJECT_NAME}] Tor status is \$status\" \$ADMIN_USER@\$HOSTNAME";
|
||||
echo ' touch /tmp/.torfailed';
|
||||
echo " echo \"\$status\" > /tmp/.torfailed";
|
||||
echo 'else';
|
||||
echo " prev_status=\$(cat /tmp/.torfailed)";
|
||||
echo " if [[ \"\$prev_status\" != \"\$status\" ]]; then";
|
||||
echo " tail -n 3 /var/log/tor/notices.log | mail -s \"[${PROJECT_NAME}] Tor status is \$status\" \$ADMIN_USER@\$HOSTNAME";
|
||||
echo " echo \"\$status\" > /tmp/.torfailed";
|
||||
echo ' fi';
|
||||
echo 'fi'; } > /usr/bin/check_tor_health
|
||||
chmod +x /usr/bin/check_tor_health
|
||||
|
||||
|
|
Loading…
Reference in New Issue