Last active
August 29, 2015 14:00
-
-
Save tanb/11258489 to your computer and use it in GitHub Desktop.
wifi接続の変更を監視してscriptを実行
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
# root所有にしておかないと実行されない | |
sudo chown root ~/Library/LaunchAgents/me.tanb.sample.plist | |
sudo launchctl load ~/Library/LaunchAgents/me.tanb.sample.plist | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>Label</key> | |
<string>me.tanb.sample</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/bin/bash</string> | |
<string>/path/to/script.sh</string> | |
</array> | |
<key>StandardErrorPath</key> | |
<string>/dev/null</string> | |
<key>StandardOutPath</key> | |
<string>/dev/null</string> | |
<key>WatchPaths</key> | |
<array> | |
<string>/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist</string> | |
<string>/Library/Preferences/SystemConfiguration/com.apple.network.identification.plist</string> | |
</array> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment