欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

重启lighttpd进程的脚本 博客分类: Linux lighttpd脚本F# 

程序员文章站 2024-02-22 16:54:16
...
#!/bin/sh
HTTPD_PID=`cat /tmp/hideto-lighttpd-9527.pid`
SUCCEED_FLAG="Syntax OK"
TEST_RESULT=`lighttpd -t -f /var/www/vhosts/hideto/conf/lighttpd/9527.conf`
echo $TEST_RESULT;
if [ "$TEST_RESULT" = "$SUCCEED_FLAG" ]; then
    echo "Now stopping lighttpd at 9527...";
    kill -INT $HTTPD_PID
    echo "Starting new lighttpd at 9527..."
    lighttpd -f /var/www/vhosts/hideto/conf/lighttpd/9527.conf &
    echo "9527 done."
else
    echo "Config Error, nothing to do. Please change your config and retry";
fi