mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-27 03:19:24 +01:00
22 lines
478 B
Python
Executable File
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))
|