Skip to content

Instantly share code, notes, and snippets.

@mechairoi
Created September 12, 2011 07:16
Show Gist options
  • Save mechairoi/1210740 to your computer and use it in GitHub Desktop.
Save mechairoi/1210740 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use List::Util qw(first);
while(1){
if (first { /\Q100.0% packet loss\E/ } `ping -W 1 -c 3 192.168.0.1`) {
`osascript ~/config/bin/toggle-air-mac.scpt`;
`osascript ~/config/bin/toggle-air-mac.scpt`;
}
sleep(10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment