Is there any way to automatically check if a network share is currently available or not, and if the state changed not only (un)mount it but perform any arbitrary other action? My best guess would be a cronjob, but maybe there's a better way for this.