举个列子:
#!/bin/bash
netstat -lptnu|grep 22
if [ $? -eq 0 ];then
echo "server is ok"
else
mail -s "srvice is error" 523738598@qq.com
fi
举个列子:
#!/bin/bash
netstat -lptnu|grep 22
if [ $? -eq 0 ];then
echo "server is ok"
else
mail -s "srvice is error" 523738598@qq.com
fi