Skip to content

Commit 8376b4a

Browse files
committed
Map constants to readable values
Thanks, @zeroSteiner and @kernelsmith. :)
1 parent 23f7fe4 commit 8376b4a

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

modules/auxiliary/gather/chromecast_wifi.rb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,26 @@ def run
4747
waps << [
4848
wap["bssid"],
4949
wap["signal_level"],
50-
wap["wpa_auth"],
51-
wap["wpa_cipher"],
50+
case wap["wpa_auth"]
51+
when 1
52+
"OPN"
53+
when 5
54+
"WPA"
55+
when 7
56+
"WPA2"
57+
else
58+
wap["wpa_auth"]
59+
end,
60+
case wap["wpa_cipher"]
61+
when 1
62+
""
63+
when 3
64+
"TKIP"
65+
when 4
66+
"CCMP"
67+
else
68+
wap["wpa_cipher"]
69+
end,
5270
wap["ssid"] + (wap["wpa_id"] ? " (*)" : "")
5371
]
5472
end

0 commit comments

Comments
 (0)