2010-10-30 14:14:12 +02:00
|
|
|
#!/usr/bin/expect -f
|
2010-10-31 09:56:33 +01:00
|
|
|
# wrapper to make passwd(1) be non-interactive
|
|
|
|
# username is passed as 1st arg, passwd as 2nd
|
|
|
|
# Executable only by root
|
|
|
|
|
2010-10-30 14:14:12 +02:00
|
|
|
set password [lindex $argv 1]
|
2010-10-31 09:56:33 +01:00
|
|
|
spawn passwd [lindex $argv 0]
|
|
|
|
expect "password:"
|
2010-10-30 14:14:12 +02:00
|
|
|
send "$password\r"
|
2010-10-31 09:56:33 +01:00
|
|
|
expect "password:"
|
2010-10-30 14:14:12 +02:00
|
|
|
send "$password\r"
|
|
|
|
expect eof
|