View previous topic :: View next topic |
Author |
Message |
passive Tux's lil' helper
Joined: 31 Dec 2004 Posts: 105
|
Posted: Thu Sep 28, 2006 1:19 pm Post subject: Mounting dependant on what network I am connected to. |
|
|
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 |
|
|
Insanity5902 Veteran
Joined: 23 Jan 2004 Posts: 1228 Location: Fort Worth, Texas
|
Posted: Thu Sep 28, 2006 1:36 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|