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   
Text File  |  2004-03-08  |  583b  |  24 lines

  1. #!/usr/bin/expect -f
  2.  
  3. set force_conservative 0  ;# set to 1 to force conservative mode even if
  4.                           ;# script wasn't run conservatively originally
  5. if {$force_conservative} {
  6.         set send_slow {1 .1}
  7.         proc send {ignore arg} {
  8.                 sleep .1
  9.                 exp_send -s -- $arg
  10.         }
  11. }
  12.  
  13. set password [lindex $argv 1]
  14.  
  15. set timeout -1
  16. spawn smbpasswd [lindex $argv 0]
  17. match_max 100000
  18. expect -exact "New SMB password:"
  19. send -- "$password\r"
  20. expect -exact "\r
  21. Retype new SMB password:"
  22. send -- "$password\r"
  23. expect eof
  24.