Created
April 5, 2012 22:16
-
-
Save daniel-garcia/2314599 to your computer and use it in GitHub Desktop.
Delete all devices with a zendmd script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zendmd | |
import sys | |
def usage(): | |
print "usage: %s [DEVICE_ID] [DEVICE_ID]" % sys.argv[1] | |
if len(sys.argv) < 3: | |
usage() | |
sys.exit() | |
if "--help" in sys.argv or "-h" in sys.argv: | |
usage() | |
sys.exit() | |
for devId in sys.argv[2:]: | |
dev = find(deviId) | |
if dev: | |
dev.deleteDevice() | |
else: | |
print "Did not find device %r" % devId | |
commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment