Created
February 22, 2012 03:42
-
-
Save gregschoen/1881148 to your computer and use it in GitHub Desktop.
Wifi Application Disable (Mac)
This file contains 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
<?php | |
// Check current Wifi Network and Disable Applications | |
$ssid_string = exec("networksetup -getairportnetwork en1"); | |
$my_ssid = "OpenWrt"; | |
preg_match("/^Current Wi-Fi Network: (?P<ssid>[^\W]+)$/", $ssid_string, $match); | |
if($match['ssid'] != $my_ssid) | |
{ | |
// Unload Automatic Preference Pane | |
exec("launchctl unload ~/Library/LaunchAgents/com.codingcurious.AutomaticHelper.plist"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment