From: Marcel Holtmann Date: Sun, 28 Dec 2008 01:58:21 +0000 (+0100) Subject: Add device argument to enable and disable scripts X-Git-Tag: 0.6~110 X-Git-Url: http://git.maemo.org/git/?p=connman;a=commitdiff_plain;h=9f5303e643adbfeb9a636c0f800509ebfd33f66c Add device argument to enable and disable scripts --- diff --git a/test/disable-device b/test/disable-device index 31e9f95..7aadab0 100755 --- a/test/disable-device +++ b/test/disable-device @@ -1,7 +1,12 @@ #!/usr/bin/python +import sys import dbus +if (len(sys.argv) < 2): + print "Usage: %s " % (sys.argv[0]) + sys.exit(1) + bus = dbus.SystemBus() manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"), @@ -15,9 +20,9 @@ for path in properties["Devices"]: properties = device.GetProperties() - if (properties["Powered"] == dbus.Boolean(0)): - continue + if properties["Interface"] != sys.argv[1]: + continue; - print "[ %s ]" % (path) + print "Disabling device %s" % (path) device.SetProperty("Powered", dbus.Boolean(0)); diff --git a/test/enable-device b/test/enable-device index e79b736..b5b1a9c 100755 --- a/test/enable-device +++ b/test/enable-device @@ -1,7 +1,12 @@ #!/usr/bin/python +import sys import dbus +if (len(sys.argv) < 2): + print "Usage: %s " % (sys.argv[0]) + sys.exit(1) + bus = dbus.SystemBus() manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"), @@ -15,9 +20,9 @@ for path in properties["Devices"]: properties = device.GetProperties() - if (properties["Powered"] == dbus.Boolean(1)): - continue + if properties["Interface"] != sys.argv[1]: + continue; - print "[ %s ]" % (path) + print "Enabling device %s" % (path) device.SetProperty("Powered", dbus.Boolean(1));