View Single Post
Old Jul 21st, 2005, 4:45 PM   #5
erauqssidlroweht
Newbie
 
Join Date: Jul 2005
Posts: 2
Rep Power: 0 erauqssidlroweht is on a distinguished road
I didn't have Expect installed so I went ahead installed and have been working with it for the week or so.

I've successfully writen a two part script. And later I expanded on this concept for every service I have.

#!/bin/sh
#Debian Linux
# Check if SMTP is up
/PAGER/smtp.exp 1>/dev/null 2>&1
if [ $? == 0 ]
then
echo "SMTP is running."
else
echo "SMTP is NOT running. Calling for help..."
/PAGER/911dial.sh
fi
#Exit


#!/usr/bin/expect -f
#The second part
set timeout 4
spawn telnet 192.168.1.10 25
expect "220 "
send "quit\r"


Thanks everyone for your help and direction.
erauqssidlroweht is offline   Reply With Quote