furmeet_events/check_sanity.sh

27 lines
872 B
Bash
Raw Normal View History

2019-08-01 18:03:21 +00:00
#!/bin/bash
2022-12-07 03:49:25 +00:00
curl -m 10 -v http://127.0.0.1 2>&1 | grep 'Server: nginx/' 1>/dev/null
2019-08-01 18:03:21 +00:00
if [ $? != 0 ]; then
2019-08-01 18:10:26 +00:00
echo "Cannot reach NGINX home. Restarting NGINX... "
2019-08-01 18:03:21 +00:00
systemctl restart nginx
fi
2022-12-07 03:49:25 +00:00
curl -m 10 http://127.0.0.1:61574/ping 2>/dev/null | grep "pong" 1>/dev/null
2019-08-01 18:03:21 +00:00
if [ $? != 0 ]; then
2019-08-01 18:10:26 +00:00
echo "Cannot hear a pong from local socket. Restarting Furmeet Events... "
2019-08-01 18:03:21 +00:00
systemctl restart furmeet-events
fi
2022-12-07 03:49:25 +00:00
curl -m 10 https://events.furmeet.app/static/ping.txt 2>/dev/null | grep "pong" 1>/dev/null
2019-08-01 18:03:21 +00:00
if [ $? != 0 ]; then
2019-08-01 18:10:26 +00:00
echo "Cannot reach NGINX ping from web. Restarting NGINX... "
2019-08-01 18:03:21 +00:00
systemctl restart nginx
fi
2022-12-07 03:49:25 +00:00
curl -m 10 https://events.furmeet.app/ping 2>/dev/null | grep "pong" 1>/dev/null
2019-08-01 18:03:21 +00:00
if [ $? != 0 ]; then
2019-08-01 18:10:26 +00:00
echo "Cannot hear ping from web. Restarting Furmeet Events and NGINX... "
2019-08-01 18:03:21 +00:00
systemctl restart nginx
systemctl restart furmeet-events
fi