script to check whether daemon is still running