summaryrefslogtreecommitdiff
path: root/test/provision-service
blob: a44b862274090e14f7945d1d3e2f058a382def24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python

import sys
import dbus

if (len(sys.argv) < 3):
	print "Usage: %s <ssid> [key=value] ..." % (sys.argv[0])
	sys.exit(1)

bus = dbus.SystemBus()

manager = dbus.Interface(bus.get_object("net.connman", "/"),
					"net.connman.Manager")

config = unicode("", "utf-8")
config += "[service_%s]\n" %(sys.argv[1])

for arg in sys.argv:
	keyval = arg.split("=", 1)
	if (len(keyval) >= 2):
		config += arg
		config += '\n'

config = config.rstrip()

manager.ProvisionService(config);

print "Sent configuration:\n%s" %(config)