How do I mount a network drive based on my IP address or wifi network? When I am at work, I mount a number of shared drives to use during the day. At home, I mount drives on my home network for home use. Is there a way that I can automatically mount the correct drives based on the network I am connected to? Ideally I would do this based on IP address, as I connect via Ethernet cable at work.

Is it necessary to use AppleScript or a shell script? I have tools like Hazel and Keyboard Maestro at my disposal.

Thank you.
set homeip to "Enter Your Home IP Here"
set homedrive to "afp://PlzUpvoteThis.Answer"
set workdrive to "smb://FeelFreeToEdit.This"

set myIP to (do shell script "curl ipinfo.io/ip") // Gets ip


if myIP is homeip then // Checks if your ip matches your home ip
    do shell script "open " &amp; homedrive
else
    do shell script "open " &amp; workdrive
end if