7 print "Usage: %s <service> off|manual|auto [<address> [prefixlen] [gateway]] [<privacy>]" % (sys.argv[0])
9 if (len(sys.argv) < 3):
13 bus = dbus.SystemBus()
14 path = "/profile/default/" + sys.argv[1]
15 service = dbus.Interface(bus.get_object('net.connman', path),
16 'net.connman.Service')
18 properties = service.GetProperties()
20 print "Setting method %s for %s" % (sys.argv[2], sys.argv[1])
22 ipv6_configuration = { "Method": sys.argv[2] }
23 if sys.argv[2] == "auto":
24 if (len(sys.argv) > 3):
25 ipv6_configuration["Privacy"] = sys.argv[3]
27 if (len(sys.argv) > 3):
28 ipv6_configuration["Address"] = sys.argv[3]
29 if (len(sys.argv) > 4):
30 ipv6_configuration["PrefixLength"] = sys.argv[4]
31 if (len(sys.argv) > 5):
32 ipv6_configuration["Gateway"] = sys.argv[5]
34 service.SetProperty("IPv6.Configuration", ipv6_configuration)
35 print "New IPv6.Configuration: ", ipv6_configuration