#!/usr/bin/expect -f

set env(TERM) vt100

set timeout 10
match_max 100000

for {set x 0} {$x<3} {incr x} {
   spawn smbclient -L $argv
   expect "Password:" {
       send -- "\004"
       expect eof {
           exit 0
       }
   }
   sleep 5
}
exit 1

