Last active
December 15, 2015 08:33
-
-
Save shao1555/c4c4c9cd4707a37fd0b1 to your computer and use it in GitHub Desktop.
Continuous shows WiFi connect information (OS X only)
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
while true | |
do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | | |
ruby -e " | |
properties = {} | |
while line = STDIN.gets | |
match = line.match(/ *(.+): (.*)/) | |
key = match[1].strip | |
value = match[2].strip | |
properties[key.strip] = value.strip if match && key && value | |
end | |
out = [] | |
%w(SSID BSSID channel MCS lastTxRate agrCtlRSSI agrCtlNoise).each do |field| | |
out << [field, properties[field]].join(': ') | |
end | |
puts %Q{#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} #{out.join(%Q{\t})}} | |
" | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment