#!/bin/bash
restartftp()
{
service vsftpd restart
echo "warning!!!! ftp have restart at `date +%Y%m%d-%k:%M:%S`" > /tmp/ftp.log
}
while true
do
netstat -tulnp |grep :21|grep vsftpd
if [ $? = 0 ]
then
echo "ftp is normal at `date +%Y%m%d-%k:%M:%S`" > /tmp/ftp.log
else
restartftp
fi
sleep 10s
done
阅读(1484) | 评论(0) | 转发(0) |