File: autopasswd.py

package info (click to toggle)
python-expect 1.0.5-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 320 kB
  • ctags: 122
  • sloc: ansic: 1,206; sh: 468; python: 157; makefile: 58
file content (19 lines) | stat: -rwxr-xr-x 350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python

# list a directory on a remote ftp site

# Usage:
#	autopasswd <user> <password>

import sys, time, string
from expect import *

f = popen2 ("passwd " + sys.argv[1], "p")
f.read ("word: ")
time.sleep (0.1)
f.write (sys.argv[2] + "\n")
f.read ("word: ")
time.sleep (0.1)
f.write (sys.argv[2] + "\n")
print string.strip (f.read ())