I'm setting up a couple of Windows laptops to mount home directories from our file server. The file server uses NFS for Linux clients and I've set up Samba for these Windows clients. At startup, I'd like them to mount using Samba when on the LAN and a secure FTP connection otherwise. I'm confident the rest can be scripted or otherwise (I have some C# experience, so if batch files are insufficient, I can write a more complex C# program), I just don't know how to approach determining whether or not the computer is on the LAN.
1 Answer
How about running an IPCONFIG /ALL and seeing if the DHCP server listed is one of your expected 'on LAN' servers?
ipconfig
shows same subnet as your office LAN? Active Directory/kerberos authentication successful?