Elegant solution for network-dependent cifs/smb mounting?
On Fri, Sep 28, 2012 at 02:45:26PM +0300, Johannes Graumann wrote:
> I am looking for a debian- (and optimally kde-) compatible solution that
> would allow me to mount cifs/smb network drives ONLY if on the network where
> they are expected to exist.
> I there was a solution that would upon attempted access to adrive
> a) check whether on the right network
> b) check whether the corresponding server is up
> c) if not b) was able to WakeOnLan the server - and wait for/monitor its
> sucessful boot
> d) mount the drive
> That would be the perfect solution ...
Perhaps have a look at whereami. That is a set of scripts that fire when
you connect to a network. It can identify which network you're on (for
example, you got a DHCP response and it was in the range x.x.x.x to
x.x.x.y). I'm fairly certain there are tests for "can I reach server
Foo?", and it wouldn't be too hard to add "can I etherwake server Foo?".