From: Daniel Wagner <daniel.wag...@bmw-carit.de> --- test/connect-vpn | 38 ++++++++++++++++++++++++++------------ 1 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/test/connect-vpn b/test/connect-vpn index 22f1370..f4fa5b8 100755 --- a/test/connect-vpn +++ b/test/connect-vpn @@ -4,7 +4,7 @@ import sys import dbus if (len(sys.argv) < 4): - print "Usage: %s <name> <host> <cookie> [cafile]" % (sys.argv[0]) + print "Usage: %s <type> <name> <host> <domain> <cookie> [cafile, cerfile, keyfile]" % (sys.argv[0]) sys.exit(1) bus = dbus.SystemBus() @@ -12,18 +12,32 @@ 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]) +print "Attempting to connect service %s" % (sys.argv[3]) -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"})) +if sys.argv[1] == "openconnect": + if (len(sys.argv) > 5): + path = manager.ConnectProvider(({ "Type": "openconnect", + "Name": sys.argv[2], + "Host": sys.argv[3], + "VPN.Domain": sys.argv[4], + "OpenConnect.Cookie": sys.argv[5], + "OpenConnect.CACert": sys.argv[6]})) + else: + path = manager.ConnectProvider(({ "Type": "openconnect", + "Name": sys.argv[2], + "Host": sys.argv[3], + "VPN.Domain": sys.argv[4], + "OpenConnect.Cookie": sys.argv[5]})) +elif sys.argv[1] == "openvpn": + path = manager.ConnectProvider(({ "Type": "openvpn", + "Name": sys.argv[2], + "Host": sys.argv[3], + "VPN.Domain": sys.argv[4], + "OpenVPN.CACert": sys.argv[5], + "OpenVPN.Cert": sys.argv[6], + "OpenVPN.Key": sys.argv[7]})) else: - path = manager.ConnectProvider(({ "Type": "openconnect", "Name": sys.argv[1], - "Host": sys.argv[2], - "OpenConnect.Cookie": sys.argv[3], - "VPN.Domain": "intel.com"})) + print "unknown service type" + sys.exit(1) print "VPN service path is %s" %(path) -- 1.7.2.3 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman