Click to See Complete Forum and Search --> : Mounting a particular share depending on os


z0mbix
10-18-2001, 05:23 AM
I use linux(MD8.0) around 99% of the time, but my g/f uses both WinME and Linux(MD8.0). On her laptop each OS has a slightly different IP address.

I was wondering if a script could detect which OS is booted by detecting IP address and then mount the relevant share eg. /mnt/louiselinux or /mnt/louisewin depending on OS.

Is there a better/easier way of doing so?

Don't know if it's relevant but the local Network is:
My linuxbox: 192.168.0.1
Laptop(Win): 192.168.0.35
Laptop(Linux): 192.168.0.103

Many Thanks

bwkaz
10-18-2001, 07:53 AM
Why not just name the shares the same? Or am I missing something?

z0mbix
10-18-2001, 11:05 AM
Would that work when one is an nfs mount and the other is a smb mount?

bwkaz
10-18-2001, 12:15 PM
Oh. That'd be what I was missing.

Probably not possible to name them the same (and you'd have to use a different FS to mount them anyway), but could you use Samba and share the directory on the Linux box?

Or, could you just ping the different IPs? If one times out (grep the output of ping), try the other, and mount the share accordingly. If you had only positive tests on the pings, (like you said "if ping 192.168.0.35 works then mount this share, else if ping 192.168.0.103 works, mount this share"), then it'd still work even if the other computer was powered down.

Stuka
10-19-2001, 11:48 AM
Seems to me your script should just try to mount both - or if you name it the same, then try to mount it with NFS and Samba both - one will fail, of course, but it shouldn't take too long to do so, and it saves you the effort of a detection routine. Of course your script could use the return value of the commands to alert you which one IS mounted.