Chinaunix首页 | 论坛 | 博客
  • 博客访问: 96345
  • 博文数量: 40
  • 博客积分: 426
  • 博客等级: 下士
  • 技术积分: 305
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-02 11:04
文章分类

全部博文(40)

文章存档

2013年(1)

2012年(1)

2011年(38)

我的朋友

分类: LINUX

2011-07-24 13:46:19

# !/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
阅读(392) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~