#!/bin/bash
clear
sleep 1
if [ "$(nmap -P0 -p25 1.2.3.4 | grep open)" ]
then
echo SMTP is ok in 1.2.3.4
else
echo SMTP problem in 1.2.3.4
fi
sleep 1
if [ "$(nmap -P0 -p110 1.2.3.4 | grep open)" ]
then
echo POP is ok in 1.2.3.4
else
echo POP problem in 1.2.3.4
fi
...........................................................................
I checked. Its working perfectly.
Thank you Chris,Tink,Hewson
|