以检测WWW,ftp,ssh,sendmail + pop3服务是否开启
来源:互联网 发布:乐语软件好用吗 编辑:程序博客网 时间:2024/05/17 02:32
转自:http://hi.baidu.com/richardlee007/blog/item/fab7a145f832a422cefca377.html
这个小脚本可以检测WWW,ftp,ssh,sendmail + pop3服务是否开启:
#!/bin/bash#program: Using to study the [ if ... then ... fi ] program
#dsk 2007/10/8 3:00
#content: I will using this program to show you sevices
#1. print the program's work in your screen
echo "Now, the service 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 runing"
else
echo "WWW is NOT runing"
fi
#3. ftp
ftp='netstat -an|grep LISTEN|grep :21'
if [ "$ftp" != "" ]; then
echo "FTP is runing"
else
echo "FTP is not runing"
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 problems of your pop3!"
elif [ "$smtp" = "" ] && [ "$pop3" != "" ]; then
echo "Sendmail have some problems of your smtp!"
else
echo "Sendmail is NOT running!"
fi
- 以检测WWW,ftp,ssh,sendmail + pop3服务是否开启
- 检测网站是否开启SSH服务
- solaris系统中关闭和开启系统服务ftp,telnet,ssh,sendmail
- Solaris系统中关闭和开启系统服务ftp,telnet,ssh,sendmail
- Ubuntu 开启FTP和SSH服务
- Centos开启telnet/ssh/ftp/sftp服务
- Linux下检测FTP服务并开启FTP服务
- Linux下检测FTP服务并开启FTP服务
- Linux下检测FTP服务并开启FTP服务
- android检测某个服务是否开启
- bat定时检测系统服务是否开启
- Android 检测服务是否开启的方法
- Ubuntu查看ssh服务是否开启
- [ubuntu 12] 开启ssh服务、ftp服务 2015年总结
- 开启 SSH服务,及FTP 工具 乱码问题
- linux 查看ip和开启ssh,ftp服务
- Archlinux开启ssh服务以使用终端登录
- Android之检测GPS服务和定位权限是否开启
- lingo sample code for a QP problem
- JavaScript实现Shift+鼠标左键多选
- 利用Filter及HttpServletResponseWrapper修改Response的内容(内容更改利用正则表达式)
- sqlite3 基本操作
- 输入两个整数序列。其中一个序列表示栈的push顺序,判断另一个序列有没有可能是对应的pop顺序
- 以检测WWW,ftp,ssh,sendmail + pop3服务是否开启
- xml不支持自定义的css模式(浏览器问题)
- ParameterizableViewController
- 用两个栈实现队列 只实现入队出队操作
- 开源中国社区
- const,static,extern,volatile,mutable用法
- lingo sample code for liveness analysis
- 异常处理
- sqlserver函数+过程,解析字符串信息作为字段,并动态更新数据表