EXTRA_DIST = list-profiles list-elements monitor-elements monitor-state \
- get-state select-network disable-network monitor-networks \
- enable-device disable-device start-scanning simple-agent \
- show-introspection test-compat test-supplicant
+ get-state set-passphrase select-network disable-network \
+ monitor-networks enable-device disable-device start-scanning \
+ simple-agent show-introspection test-compat test-supplicant
MAINTAINERCLEANFILES = Makefile.in
--- /dev/null
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 3):
+ print "Usage: %s <network> <passphrase>" % (sys.argv[0])
+ sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
+ "org.moblin.connman.Manager")
+
+properties = manager.GetProperties()
+
+for path in properties["Devices"]:
+ device = dbus.Interface(bus.get_object("org.moblin.connman", path),
+ "org.moblin.connman.Device")
+
+ properties = device.GetProperties()
+
+ for path in properties["Networks"]:
+ network = dbus.Interface(bus.get_object("org.moblin.connman", path),
+ "org.moblin.connman.Network")
+
+ properties = network.GetProperties()
+
+ if (properties["WiFi.Name"] == sys.argv[1]):
+ print "Setting passphrase for %s" % (path)
+ network.SetProperty("WiFi.Passphrase", sys.argv[2])