Skip to content

Instantly share code, notes, and snippets.

@gregschoen
Created February 22, 2012 03:42
Show Gist options
  • Save gregschoen/1881148 to your computer and use it in GitHub Desktop.
Save gregschoen/1881148 to your computer and use it in GitHub Desktop.
Wifi Application Disable (Mac)
<?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