Skip to content

Instantly share code, notes, and snippets.

@tommorris
Created November 6, 2008 21:04
Show Gist options
  • Save tommorris/22703 to your computer and use it in GitHub Desktop.
Save tommorris/22703 to your computer and use it in GitHub Desktop.
require 'ping'
fe_rules = Array.new
fe_rules << Proc.new do
`wlanconfig ath0 list ap`.split("\n")[1..-1].map {|i| i.split}.each {|net|
if net[1] == "00:1c:10:87:57:eb"
true
elsif net[0] == "GRANGE"
[true, "Kensington Square, London"]
elsif net[0] == "BritishLibrary"
[true, "British Library, London"]
end
}
end
fe_rules << Proc.new do
true if Ping.pingecho("imac.local", 2) || Ping.pingecho("darwin.local", 2)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment