3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-09 13:39:23 +01:00
iwd/test/list-known-networks
2016-07-14 10:04:04 -05:00

22 lines
478 B
Python
Executable File

#!/usr/bin/python3
import sys
import dbus
bus = dbus.SystemBus()
kn = dbus.Interface(bus.get_object("net.connman.iwd", "/"),
"net.connman.iwd.KnownNetworks")
if len(sys.argv) >= 4 and sys.argv[1] == 'forget':
kn.ForgetNetwork(sys.argv[2], sys.argv[3])
print('Known Networks:')
for network in kn.ListKnownNetworks():
print("[ %s ]" % network['Name'])
for key in network:
val = network[key]
print(" %s = %s" % (key, val))