# !/bin/bash
# program:
# Using netstat and grep to detect WWW,SSH,FTP and MAIL services.
# History:
# 2011/07/24 canfg release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
echo "Now,I will detect your Linux server's services!"
echo -e "The www,ftp,ssh,and mail will be detect! \n"
testing=$(netstat -tuln | grep ":80")
if [ "testint" != "" ];then
echo "WWW is runing in your system."
fi
testing=$(netstat -tuln | grep ":22")
if [ "testing" != "" ];then
echo "SSH is runing your system."
fi
testing=$(netstat -tuln | grep ":21")
if [ "testing" != "" ];then
echo "FTP is runing your system."
fi
testing=$(netstat -tuln | grep ":25")
if [ "testing" != "" ];then
echo "MAIL is runing your system."
fi
阅读(417) | 评论(0) | 转发(0) |