summaryrefslogtreecommitdiff
path: root/test/vpn-connect
diff options
context:
space:
mode:
Diffstat (limited to 'test/vpn-connect')
-rwxr-xr-xtest/vpn-connect24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/vpn-connect b/test/vpn-connect
new file mode 100755
index 00000000..0f8636da
--- /dev/null
+++ b/test/vpn-connect
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if (len(sys.argv) < 2):
+ print "Usage: %s <VPN connection id>" % (sys.argv[0])
+ sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object("net.connman.vpn", "/"),
+ "net.connman.vpn.Manager")
+
+connections = manager.GetConnections()
+
+path = "/net/connman/vpn/connection/" + sys.argv[1]
+
+print "Attempting to connect VPN %s" % (path)
+
+connection = dbus.Interface(bus.get_object("net.connman.vpn", path),
+ "net.connman.vpn.Connection")
+
+connection.Connect()