代码拉取完成,页面将自动刷新
#!/bin/sh
pidFile="/var/pt_server_pid";
function start(){
php pt_server.php $pidFile
if [ $? == 0 ]; then
printf "\tserver start OK\n"
return 0
else
printf "\tserver start FAIL\n"
return 1
fi
}
function stop(){
if [ -f "$pidFile" ]; then
pid=`cat $pidFile`
if [ -n "$pid" ];then
kill -15 $pid
if [ $? == 0 ];then
printf "\t server stop OK \n"
return 0
fi
fi
printf "\t server stop FAIL \n"
return 2
fi
printf "\t server is not run\n"
return 3
}
case $1 in
start )
start
;;
stop)
stop
;;
restart)
stop
sleep 1
start
;;
*)
start
;;
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。