Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mounting dependant on what network I am connected to.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
passive
Tux's lil' helper
Tux's lil' helper


Joined: 31 Dec 2004
Posts: 105

PostPosted: Thu Sep 28, 2006 1:19 pm    Post subject: Mounting dependant on what network I am connected to. Reply with quote

On my home network, I do a lot of my work off of a file server, accessed over an NFS volume. I have also set it up so I can access this remotely, using SSHFS to mount it to the same place. What I would like to be able to do is simply tell it to mount /home/user/work, and have it determine what commands to do based on whether I am on my home network or not.
What's the best practice for this type of situation?

Also, on a secondary note, I currently mount all my network drives manually, simply due to some uncertaintly about what would happen if I didn't. What do most people do in this situation?

Thanks.
Back to top
View user's profile Send private message
Insanity5902
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1228
Location: Fort Worth, Texas

PostPosted: Thu Sep 28, 2006 1:36 pm    Post subject: Reply with quote

I mount all my drives manually on my laptop, but my dekstop i just use fstab as the network shouldn't be goign anywhere :)

As for your script, the first thing that cames to mind is a simple bash script that searches for an IP of your home network. If it isn't, it uses SSH, otherwise it mounts it using nfs.

The only problem for this is if you go to another house, that uses the same network. You could give yourself a static IP, and then check for that specific ip, not just the network, but there is still the slim chance you would get the same IP.

But worse case, is when you run the script, it tries to mount via nfs, doesn't, and then just poops out.
_________________
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum