summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-28 02:58:21 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-28 02:58:21 +0100
commit9f5303e643adbfeb9a636c0f800509ebfd33f66c (patch)
tree66ba534bd6933b10e5b530fc6a4af5ae4de00a44 /test
parentdba2854c4a36e8848aeec7b1e7d8c24b17147222 (diff)
downloadconnman-9f5303e643adbfeb9a636c0f800509ebfd33f66c.tar.gz
connman-9f5303e643adbfeb9a636c0f800509ebfd33f66c.tar.bz2
connman-9f5303e643adbfeb9a636c0f800509ebfd33f66c.zip
Add device argument to enable and disable scripts
Diffstat (limited to 'test')
-rwxr-xr-xtest/disable-device11
-rwxr-xr-xtest/enable-device11
2 files changed, 16 insertions, 6 deletions
diff --git a/test/disable-device b/test/disable-device
index 31e9f951..7aadab01 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 <device>" % (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 e79b7361..b5b1a9cc 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 <device>" % (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));