So Sleepy!!! Change check_network() into just that, add a check for a file, decide on a location for the connection.log (maybe /var/log)