alzambo
Posts: 24
Joined: Wed Jun 19, 2013 8:51 pm

automatically mount/unmount cifs upon pinging host

Wed Jul 17, 2013 9:30 pm

Hi,
I need to build a shell script that periodically checks if a lan host is online and mount or unmount (if mounted) consequentially a cifs / smb folder, making available as smb network folder for the lan.

I'm kind a newbie in linux, knowing only some basic stuff... but i'd like to learn... is there someone that could help me?

Thank you
Alex - Italy

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: automatically mount/unmount cifs upon pinging host

Thu Jul 18, 2013 9:05 am

An alternative might be to use autofs to mount the folder ony if/when required.

Un-mounting when the host is no longer up might not work too well.

This should get you going:
https://help.ubuntu.com/community/Autofs

alzambo
Posts: 24
Joined: Wed Jun 19, 2013 8:51 pm

Re: automatically mount/unmount cifs upon pinging host

Sat Jul 20, 2013 1:54 pm

Thank you, I'll give it a try

Alex

alzambo
Posts: 24
Joined: Wed Jun 19, 2013 8:51 pm

Re: automatically mount/unmount cifs upon pinging host (SOLV

Mon Jul 29, 2013 6:36 pm

Finally I managed to configure it correctly... is seems a very good solution!
Only a little bit of lag (about 10 sec) when trying to enter a mounted share that is offline but I can survive that! ;)

Thank you sprinkmeier!
Alex

Return to “General discussion”