Well been a while, but I've been watching this thread silently hehe.
The mainline installer is now at 2.0.14. The main installer is always updated in AMTM before me, so you can try that. He always pushes me a pull request every time now.
Anyway to put things to rest regarding the watchdog in my script is this:
Code:
start_monitor () {
trap "" 1
while [ `nvram get ntp_ready` -eq 0 ]; do sleep 1; done
local NW_STATE
local RES_STATE
local COUNT=0
while true; do
if [ -f /jffs/dnscrypt/localtime ]; then
if [ $COUNT -eq 90 ]; then
COUNT=0
touch "$0"
fi
COUNT=$((COUNT + 1))
fi
ping 8.8.8.8 -c1 -W2 >/dev/null 2>&1
NW_STATE=$?
nslookup google.com >/dev/null 2>&1
RES_STATE=$?
if [ -f /jffs/dnscrypt/dnscrypt-proxy ]; then
if [ -z "`pidof dnscrypt-proxy`" ]; then
logger "Warning: dnscrypt-proxy is dead"
start_dnscrypt
elif [ $NW_STATE -eq 0 ] && [ $RES_STATE -ne 0 ]; then
logger "Warning: dnscrypt-proxy is not responding"
start_dnscrypt
fi
fi
sleep 10
done
}
Basically it works by checking every 10 seconds if network is working by pinging 8.8.8.8 then checking if dns resolving works. If network works but dns resolving does not then it restarts dnscrypt.