summaryrefslogtreecommitdiff
path: root/boot/listwifi.py
diff options
context:
space:
mode:
Diffstat (limited to 'boot/listwifi.py')
-rwxr-xr-xboot/listwifi.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/boot/listwifi.py b/boot/listwifi.py
new file mode 100755
index 0000000..5ee14de
--- /dev/null
+++ b/boot/listwifi.py
@@ -0,0 +1,18 @@
+import os
+import subprocess
+
+subprocess.call("iwlist wlan0 scan > temp.txt", shell = True)
+output = open("temp.txt")
+
+lines = output.readlines()
+
+for index, line in enumerate(lines):
+
+ if "Address" in line:
+
+ address = line[29:-1]
+ name = lines[index + 1].split("\"")[1]
+
+ print "%s is %s" % (address, name)
+
+os.system("rm temp.txt")