Merge "[gdhcp/client] Reopen socket GIO channel when failed" into tizen
[platform/upstream/connman.git] / test / vpn-connect
1 #!/usr/bin/python
2
3 import sys
4 import dbus
5
6 if (len(sys.argv) < 2):
7         print "Usage: %s <VPN connection id>" % (sys.argv[0])
8         sys.exit(1)
9
10 bus = dbus.SystemBus()
11
12 manager = dbus.Interface(bus.get_object("net.connman.vpn", "/"),
13                                         "net.connman.vpn.Manager")
14
15 connections = manager.GetConnections()
16
17 path = "/net/connman/vpn/connection/" + sys.argv[1]
18
19 print "Attempting to connect VPN %s" % (path)
20
21 connection = dbus.Interface(bus.get_object("net.connman.vpn", path),
22                                             "net.connman.vpn.Connection")
23
24 connection.Connect()