2015-07-02

centOS 檢查 httpd 服務是否活著 若是沒啟動 自動重起



#!/bin/bash

if [ -z "`/etc/rc.d/init.d/./httpd status|grep 'is running'`" ]
then
        /etc/rc.d/init.d/./httpd start
        echo "`date +"%b %e %T"` httpd service is done" >> /var/log/service_test.log
fi

沒有留言: