mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add a check to detect when dnsmasq not working in omr-schedule
This commit is contained in:
parent
bc4c45821d
commit
6e158986e4
1 changed files with 10 additions and 4 deletions
|
@ -28,10 +28,16 @@ if [ -f /etc/init.d/glorytun-udp ] && [ "$(pgrep glorytun-udp)" = "" ] && [ "$(u
|
|||
sleep 5
|
||||
fi
|
||||
|
||||
if [ "$(pgrep -f dnsmasq)" = "" ] && [ -f /etc/init.d/dnsmasq ]; then
|
||||
_log "Can't find dnsmasq, restart it..."
|
||||
/etc/init.d/dnsmasq restart 2>&1 >/dev/null
|
||||
sleep 5
|
||||
if [ -f /etc/init.d/dnsmasq ]; then
|
||||
if [ "$(pgrep -f dnsmasq)" = "" ]; then
|
||||
_log "Can't find dnsmasq, restart it..."
|
||||
/etc/init.d/dnsmasq restart 2>&1 >/dev/null
|
||||
sleep 5
|
||||
elif [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ] && [ -n "$(dig +timeout=4 +tries=1 openmptcprouter.com | grep 'connection refused')" ]; then
|
||||
_log "Can't resolve via dnsmasq, restart it..."
|
||||
/etc/init.d/dnsmasq restart 2>&1 >/dev/null
|
||||
sleep 5
|
||||
fi
|
||||
fi
|
||||
if [ -f /etc/init.d/unbound ] && [ "$(uci -q get unbound.@unbound[0].enabled)" = "1" ]; then
|
||||
if [ "$(pgrep -f unbound)" = "" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue