home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 April
/
CMCD0404.ISO
/
Software
/
Freeware
/
Programare
/
groupoffice-com-2.01
/
lib
/
samba
/
auto_smbpasswd.exp
< prev
Wrap
Text File
|
2004-03-08
|
583b
|
24 lines
#!/usr/bin/expect -f
set force_conservative 0 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}
set password [lindex $argv 1]
set timeout -1
spawn smbpasswd [lindex $argv 0]
match_max 100000
expect -exact "New SMB password:"
send -- "$password\r"
expect -exact "\r
Retype new SMB password:"
send -- "$password\r"
expect eof