6 if (len(sys.argv) != 2):
7 print "Usage: %s type" % (sys.argv[0])
10 bus = dbus.SystemBus()
12 manager = dbus.Interface(bus.get_object('net.connman', "/"),
13 'net.connman.Manager')
15 def technology_disable_tethering(path, tech_type):
16 tech = dbus.Interface(bus.get_object("net.connman", path),
17 "net.connman.Technology")
19 properties = tech.GetProperties()
21 for key in properties.keys():
23 if properties[key] == tech_type:
24 print "Disabling %s tethering" % tech_type
25 tech.SetProperty("Tethering", dbus.Boolean(0))
31 technologies = manager.GetTechnologies()
34 for path,_ in technologies:
35 tech = technology_disable_tethering(path, sys.argv[1])
40 print "Failed to disable %s tethering" % (sys.argv[1])