#!/bin/sh
# \
exec expect "$0" ${1+"$@"}
# wrapper to make passwd(1) be non-interactive
# username is passed as 1st arg, passwd as 2nd

set smbpassword [lindex $argv 1]
spawn smbpasswd [lindex $argv 0]
expect "password:"
send "$smbpassword\r"
expect "password:"
send "$smbpassword\r"
expect eof
