blob: 62701d2f0e1aae0d4ae9d55370ebc84f1e12c9e0 [file] [log] [blame]
#!/usr/bin/python
import dbus, flimflam, sys
if (len(sys.argv) < 2):
print "Usage: %s <device | interface>" % (sys.argv[0])
sys.exit(1)
(_, name) = sys.argv
flim = flimflam.FlimFlam(dbus.SystemBus())
device = flim.FindElementByNameSubstring('Device', name)
if device is None:
device = flim.FindElementByPropertySubstring('Device', 'Interface', name)
print "Disabling device %s" % (device.object_path)
# Shill uses the Disable method, flimflam uses a SetProperty call
try:
device.Disable()
except dbus.DBusException, error:
device.SetProperty("Powered", dbus.Boolean(0));