overlay/Documentation/ls_pro_live/root_overlay/usr/local/bin/changepassword
2010-10-31 08:56:33 +00:00

12 lines
288 B
Plaintext
Executable File

#!/usr/bin/expect -f
# wrapper to make passwd(1) be non-interactive
# username is passed as 1st arg, passwd as 2nd
# Executable only by root
set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
expect "password:"
send "$password\r"
expect "password:"
send "$password\r"
expect eof