daemon.sh: various fixes.

Use the status file as timing reference (the daemon code creates a temp file on status check, so the directory modification time changes).