2010-04-16 19:42:27 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import dbus
|
|
|
|
|
|
|
|
bus = dbus.SystemBus()
|
|
|
|
|
|
|
|
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
|
|
|
'org.ofono.Manager')
|
|
|
|
|
2010-09-09 19:37:37 +00:00
|
|
|
modems = manager.GetModems()
|
2010-04-16 19:42:27 +00:00
|
|
|
|
2010-09-09 19:37:37 +00:00
|
|
|
for path, properties in modems:
|
2010-08-19 18:25:51 +00:00
|
|
|
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
|
2010-04-16 19:42:27 +00:00
|
|
|
continue
|
|
|
|
|
2010-08-19 18:25:51 +00:00
|
|
|
connman = dbus.Interface(bus.get_object('org.ofono', path),
|
|
|
|
'org.ofono.ConnectionManager')
|
2010-04-16 19:42:27 +00:00
|
|
|
|
2010-08-19 18:25:51 +00:00
|
|
|
contexts = connman.GetContexts()
|
2010-04-16 19:42:27 +00:00
|
|
|
|
2010-08-19 18:25:51 +00:00
|
|
|
for path, properties in contexts:
|
|
|
|
connman.RemoveContext(path)
|
2010-04-16 19:42:27 +00:00
|
|
|
print"Removed: [ %s ]" % (path)
|