Created
November 16, 2014 11:12
-
-
Save joker1007/c7e116c5eb2389ebc6a0 to your computer and use it in GitHub Desktop.
特定のIPが割り当てられた時、NASを自動でマウントするAppleScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global prevIpValue | |
set prevIpValue to "" | |
on idle | |
set newIpValue to IPv4 address of (get system info) as string | |
if newIpValue = "192.168.1.80" and not newIpValue = prevIpValue then | |
try | |
display alert "NASをマウントします" | |
do shell script "/Users/joker/bin/mount_nas.sh" | |
end try | |
end if | |
set prevIpValue to newIpValue | |
return 10 -- time in seconds to perform checking | |
end idle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment