Chinaunix首页 | 论坛 | 博客
  • 博客访问: 575976
  • 博文数量: 836
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 4995
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-22 16:55
文章分类

全部博文(836)

文章存档

2008年(836)

我的朋友

分类: LINUX

2008-08-22 17:41:18

 
这个小脚本可以检测WWW,ftp,ssh,sendmail pop3服务是否开启:
#!/bin/bash
#program:Usingtostudythe[if...then...fi]program
#dsk2007/10/83:00
#content:Iwillusingthisprogramtoshowyousevices
#1.printtheprogram''sworkinyourscreen
echo"Now,theserviceofyourLinuxsystemwillbedetect!"
echo"Thewww,ftp,ssh,andsendmail pop3willbedetect!"
echo""
#2.www
www=''netstat-an|grepLISTEN|grep:80''
if["$www"!=""];then
echo"WWWisruning"
else
echo"WWWisNOTruning"
fi
#3.ftp
ftp=''netstat-an|grepLISTEN|grep:21''
if["$ftp"!=""];then
echo"FTPisruning"
else
echo"FTPisnotruning"
fi
#4.ssh
ssh=''netstat-an|grepLISTEN|grep:22''
if["$ssh"!=""];then
echo"SSHisrunning"
else
echo"SSHisnotrunning"
fi
#5.sendmail pop3
smtp=''netstat-an|grepLISTEN|grep:25''
pop3=''netstat-an|grepLISTEN|grep:110''
if["$smtp"!=""]&&["$pop3"!=""];then
echo"SendmailisOK!"
elif["$smtp"!=""]&&["$pop3"=""];then
echo"Sendmailhavesomeproblemsofyourpop3!"
elif["$smtp"=""]&&["$pop3"!=""];then
echo"Sendmailhavesomeproblemsofyoursmtp!"
else
echo"SendmailisNOTrunning!"
fi

阅读(195) | 评论(0) | 转发(0) |
0

上一篇:suse 安装 vmware

下一篇:Ubuntu 7.10 安装软件

给主人留下些什么吧!~~