aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJose Vasconcellos <jvasco@verizon.net>2009-01-15 22:05:10 +0000
committerJose Vasconcellos <jvasco@verizon.net>2009-01-15 22:05:10 +0000
commit53729b100e398cd8578e4943cd9820f6f0a20094 (patch)
tree602ea93a16453e92f68812331c75fcd8308e1f82 /scripts
parent94e7ab5c412125d69c97a9e196cc43ea6927d861 (diff)
downloadmaster-187ad058-53729b100e398cd8578e4943cd9820f6f0a20094.tar.gz
master-187ad058-53729b100e398cd8578e4943cd9820f6f0a20094.tar.bz2
master-187ad058-53729b100e398cd8578e4943cd9820f6f0a20094.zip
Fix parsing of password option; set timeout for writing.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14046 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rw-r--r--scripts/flashing/jungo-image.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/scripts/flashing/jungo-image.py b/scripts/flashing/jungo-image.py
index 0630b4a77e..326a48229a 100644
--- a/scripts/flashing/jungo-image.py
+++ b/scripts/flashing/jungo-image.py
@@ -150,7 +150,7 @@ def usage():
try:
opts, args = getopt.getopt(sys.argv[1:], "hdf:u:qp:P:s:vVw", \
- ["help", "dump", "file=", "user=", "pass=", "proto=", "proto=",
+ ["help", "dump", "file=", "user=", "pass=", "port=", "proto=",
"quiet=", "server=", "verbose", "version", "write"])
except getopt.GetoptError:
# print help information and exit:
@@ -161,28 +161,28 @@ for o, a in opts:
if o in ("-h", "--help"):
usage()
sys.exit(1)
- if o in ("-V", "--version"):
- print "%s: 0.7" % sys.argv[0]
+ elif o in ("-V", "--version"):
+ print "%s: 0.8" % sys.argv[0]
sys.exit(1)
- if o in ("-d", "--no-dump"):
+ elif o in ("-d", "--no-dump"):
no_dump = 1
- if o in ("-f", "--file"):
+ elif o in ("-f", "--file"):
dumpfile = a
- if o in ("-s", "--server"):
+ elif o in ("-s", "--server"):
server = a
- if o in ("-u", "--user"):
+ elif o in ("-u", "--user"):
user = a
- if o in ("-p", "--pass"):
+ elif o in ("-p", "--pass"):
password = a
- if o in ("-P", "--proto"):
+ elif o in ("-P", "--proto"):
proto = a
- if o in ("--port"):
- PORT = a
- if o in ("-w", "--write"):
+ elif o == "--port":
+ PORT = int(a)
+ elif o in ("-w", "--write"):
write_image = 1
- if o in ("-q", "--quiet"):
+ elif o in ("-q", "--quiet"):
verbose = 0
- if o in ("-v", "--verbose"):
+ elif o in ("-v", "--verbose"):
verbose = 1
# make sure we have enough arguments
@@ -252,7 +252,7 @@ if write_image:
print "Writing new image..."
print cmd,
tn.write(cmd)
- buf = tn.read_until("Returned 0")
+ buf = tn.read_until("Returned 0",10)
tn.write("exit\n")
tn.close()