[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash Script for Mail sending Check



On Thu, Apr 16, 2009 at 11:28:10AM +0530, Kurian Thayil (kurianmthayil@gmail.com) wrote:

> I got your modification working only when telnet gives a prompt,

Right you are - telnet doesn't react to the escape sequence
before connecting. Bummer. :-(

Oh well, just kill it then:

#! /bin/bash
case "$( (sleep 5; echo quit; ps |awk '/telnet/{print "kill "$1}' |sh) | telnet 192.168.0.20 25 2>&- )"
in
  *'
220 '*) echo Success ;;
  *)    echo Failed ;;
esac


-- 
Tapani Tarvainen


Reply to: