文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Test port port.sh

Test port port.sh

时间:2010-05-08  来源:hjjie2006

vi port.sh      #!/bin/bash                                                     # program: Using to study the [if ... then ... fi] program
# Made by:  VBird
# date:  2002/05/20
# content: I will using this program to show your services

# 1. print the program's work in your screen
  echo "Now, the services of your Linux system will be detect!"
  echo "The www, ftp, ssh, and sendmail + pop3 will be detect!"
  echo " "

# 2. www
  www=`netstat -an|grep LISTEN|grep :80`                    
  if [ "$www" != "" ]; then                                      
      echo "WWW is running"                                 
  else
      echo "WWW is NOT running"
  fi

# 3. ftp
  ftp=`netstat -an|grep LISTEN|grep :21`
  if [ "$ftp" != "" ]; then
      echo "FTP is running"
  else
      echo "FTP is NOT running"
  fi

# 4. ssh
  ssh=`netstat -an|grep LISTEN|grep :22`
  if [ "$ssh" != "" ]; then
      echo "SSH is running"
  else
      echo "SSH is NOT running"
  fi

# 5. sendmail + pop3
  smtp=`netstat -an|grep LISTEN|grep :25`
  pop3=`netstat -an|grep LISTEN|grep :110`
  if [ "$smtp" != "" ]   && [ "$pop3" != "" ]; then           
      echo "sendmail is OK!"
  elif [ "$smtp" != "" ] && [ "$pop3"  = "" ]; then
      echo "sendmail have some problem of your pop3"
  elif [ "$smtp"  = "" ] && [ "$pop3" != "" ]; then
      echo "sendmail have some problem of your smtp"
  else
      echo "sendmail is NOT running"
  fi

[test @test test]# sh port.sh                               
Now, the services of your Linux system will be detect!
The www, ftp, ssh, and sendmail + pop3 will be detect!

WWW is running
FTP is running
SSH is running
sendmail is OK!

 

Reprinted:VBird

相关阅读 更多 +
排行榜 更多 +
我是班长去广告版下载

我是班长去广告版下载

模拟经营 下载
什么鸭小游戏安卓版下载

什么鸭小游戏安卓版下载

策略塔防 下载
极光影院官方最新版本2025下载

极光影院官方最新版本2025下载

趣味娱乐 下载