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["Technologies"]:
18 technology = dbus.Interface(bus.get_object("org.moblin.connman", path),
19 "org.moblin.connman.Technology")
21 properties = technology.GetProperties()
23 for path in properties["Devices"]:
24 device = dbus.Interface(bus.get_object("org.moblin.connman", path),
25 "org.moblin.connman.Device")
27 properties = device.GetProperties()
29 if (properties["Type"] != "wifi" and properties["Type"] != "wimax"):
32 for path in properties["Networks"]:
33 network = dbus.Interface(bus.get_object("org.moblin.connman", path),
34 "org.moblin.connman.Network")
36 properties = network.GetProperties()
38 if "Name" not in properties:
41 if properties["Name"] == sys.argv[1]:
42 print "Setting passphrase for %s" % (path)
43 network.SetProperty("WiFi.Passphrase", sys.argv[2])