I would like my macbook to connect via a reverse shell to my server while the lid is closed. Can I wake it up from sleep every N seconds/minutes and try to connect, and if no connection is established, go back to sleep again?
lid is closed.
* wake up
* connect to any wlan available
* connect through ssh to my server
* if no answer is received through ssh then go back to sleep
* wait N minutes then loop
Any service through which I can send commands will do. Even irc if I can make the mac run commands entered.