summaryrefslogtreecommitdiff
path: root/test/connect-vpn
blob: c9cbd89dc615d75ecff64ab7de967894a4f774f9 (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],
				"OpenConnect.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],
				"OpenConnect.Host": sys.argv[2],
				"OpenConnect.Cookie": sys.argv[3],
				"VPN.Domain": "intel.com"}))

print "Provider path is %s" %(path)