Added a hook interface so you can extend it with your own scripts

You can for example easily run a rsync to keep all the data in sync
between reconnects.