6 if (len(sys.argv) < 2):
7 print "Usage: %s type" % (sys.argv[0])
9 print "Disabling %s tethering" % (sys.argv[1])
11 bus = dbus.SystemBus()
13 manager = dbus.Interface(bus.get_object('net.connman', "/"),
14 'net.connman.Manager')
16 def technology_disable_tethering(path, tech_type):
17 tech = dbus.Interface(bus.get_object("net.connman", path),
18 "net.connman.Technology")
20 properties = tech.GetProperties()
22 for key in properties.keys():
24 if properties[key] == tech_type:
25 tech.SetProperty("Tethering", dbus.Boolean(0))
27 properties = manager.GetProperties()
29 for key in properties.keys():
30 if key in ["Technologies"]:
31 for path in properties[key]:
32 technology_disable_tethering(path, sys.argv[1])