def getBSSID(interface):
proc = subprocess.Popen(['iw', 'dev', interface, 'link'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = proc.communicate()
out = decodeUTF8(out)
syslog(LOG_INFO, out)
try:
out = out.split('Connected to ')[1]
out = out.split(' (on ')[0]
except IndexError as e:
syslog(LOG_INFO, e.value)
return out
评论列表
文章目录