All
I want to telnet bunch of mx servers from expect script just to check the mailserver program used from their banner (if exist) from the expect script like this :
Quote:
#!/usr/bin/expect -d
mxcount=`wc -l mxfile`
count=1
mxs=$( awk 'NR == '$count'' mxfile )
var=$(expect -c"
set timeout 5
spawn telnet $mxs 25 ---> the problems lies here and the rest
set timeout 10
expect "220*"
set timeout 10
send "helo just-test.org\n"
set timeout 10
expect "250*"
send "quit\n"
exit
")
while [ "$count" -le $mxcount ]
do
echo "$var"
let "count += 1"
done
|
mxfile contain the mailservers hostname I want to check separated by line.
And the script not work. I'm newbie pretended to be expert :-)
Please help.
Thanks.