summaryrefslogtreecommitdiff
path: root/test/connect-vpn
blob: 22f13709c8097187d12d181bb0c08a9297eb7117 (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
29
#!/usr/bin/python

import sys
import dbus

if (len(sys.argv) < 4):
	print "Usage: %s <name> <host> <cookie> [cafile]" % (sys.argv[0])
	sys.exit(1)

bus = dbus.SystemBus()

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

print "Attempting to connect service %s" % (sys.argv[1])

if (len(sys.argv) > 4):
	path = manager.ConnectProvider(({ "Type": "openconnect", "Name": sys.argv[1],
				"Host": sys.argv[2],
				"OpenConnect.Cookie": sys.argv[3],
				"OpenConnect.CACert": sys.argv[4],
				"VPN.Domain": "intel.com"}))
else:
	path = manager.ConnectProvider(({ "Type": "openconnect", "Name": sys.argv[1],
				"Host": sys.argv[2],
				"OpenConnect.Cookie": sys.argv[3],
				"VPN.Domain": "intel.com"}))

print "VPN service path is %s" %(path)