7 print "Usage: %s <service> [off|dhcp|manual <address> [netmask]]" % (sys.argv[0])
10 if (len(sys.argv) < 3):
14 bus = dbus.SystemBus()
15 path = "/profile/default/" + sys.argv[1]
16 service = dbus.Interface(bus.get_object('net.connman', path),
17 'net.connman.Service')
19 properties = service.GetProperties()
21 print "Setting method %s for %s" % (sys.argv[2], sys.argv[1])
23 ipv4_configuration = { "Method": sys.argv[2] }
24 if (len(sys.argv) > 3):
25 ipv4_configuration["Address"] = sys.argv[3]
26 if (len(sys.argv) > 4):
27 ipv4_configuration["Netmask"] = sys.argv[4]
28 if (len(sys.argv) > 5):
29 ipv4_configuration["Gateway"] = sys.argv[5]
31 service.SetProperty("IPv4.Configuration", ipv4_configuration)
32 print "New IPv4.Configuration: ", ipv4_configuration