|
|||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
Help on how to get Mac to check IP then back up to Home Directory
Hello,
I'm trying to figure out how to create a script that would check I'm on my Work network then RSYNC the contents of my Documents folder to my Windows Home Directory share (I really don't want the Mac trying to connect to my Windows share on my home network). Also, Mac's aren't part of Active Directory in my work place and the Home Drives aren't delivered by Policy, I'd also have to mount my home drive prior to the RSYNC. I have some bits and pieces of the puzzle but not enough scripting/Unix knowledge to build a functioning script out of it. For example : To check the current IP I have found this prints my current LAN IP : ifconfig en0 | awk '/inet / {print $2}' But I would need the script to take the output and check the IP matches the first 2 octets of my work's class B network and if not send a failure message. I know how to mount my home Drive : mount_smbfs -W domain //user@server/share ~/mountpoint I think this is how a basic RSYNC would work minus the exclusion of non work file types which I'll add later : rsync -avz ~/Documents/ ~MountPoint/ It's a bit of a tall order but I'm mainly insterested in the first part of taking the IP output and creating an If/Then statement that'd confirm if on the right network. Many thanks to anyone who replies, I'd really appreciate any, and that's ANY, input on this. Best regards, Simon |
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|