本文共 500 字,大约阅读时间需要 1 分钟。
# vi haproxy.sh
#!/bin/bashPort=`netstat -ntpl | grep haproxy | awk -F[:" "]+ '{print $5}'`
if [[ $Port == "1080" ]];then echo "haproxy is running at time:`date +%y/%m/%d-%H:%M`" >> /usr/local/apache/logs/haproxy.log else echo "haproxy is down at time:`date +%y/%m/%d-%H:%M`" >> /usr/local/apache/logs/haproxy.log /usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg fi:wq 注:写时千万注意空格
本文转自linux博客51CTO博客,原文链接http://blog.51cto.com/yangzhiming/874418如需转载请自行联系原作者
yangzhimingg