6 if (len(sys.argv) < 3):
7 print "Usage: %s <network> <passphrase>" % (sys.argv[0])
10 bus = dbus.SystemBus()
12 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
13 "org.moblin.connman.Manager")
15 properties = manager.GetProperties()
17 for path in properties["Devices"]:
18 device = dbus.Interface(bus.get_object("org.moblin.connman", path),
19 "org.moblin.connman.Device")
21 properties = device.GetProperties()
23 if (properties["Type"] != "wifi" and properties["Type"] != "wimax"):
26 for path in properties["Networks"]:
27 network = dbus.Interface(bus.get_object("org.moblin.connman", path),
28 "org.moblin.connman.Network")
30 properties = network.GetProperties()
32 if "Name" not in properties:
35 if properties["Name"] == sys.argv[1]:
36 print "Setting passphrase for %s" % (path)
37 network.SetProperty("WiFi.Passphrase", sys.argv[2])