Author: Øyvind Stegard <oyvind.stegard@ifi.uio.no> License: Public domain, use at own risk, no warranties of any kind. Requires Emacs23 with D-Bus bindings and preferably a running NetworkManager instance.
You will need to call the function ‘nm-enable’ for things to start happening. Functions you would like to run when network is connected: (add-hook ’nm-connected-hook ’ping-skynet)
Functions you would like to run when network is disconnected: (add-hook ’nm-disconnected-hook (lambda() (message "Darnit, we are down.")))