💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
``` #!/bin/bash date=$(/bin/date +%F-%H:%M) prefix=/root/script/php_kill php_bash_PID=${prefix}/run.pid create_pid(){ if [ ! -f "${php_bash_PID}" ] ; then echo "$$" >> ${php_bash_PID} echo "${date} create php_kill pid" >> /tmp/php_status.log else echo "php kill is runnin,waitting" >> /tmp/php_status.log exit 1 fi } remove_pid(){ if [ -f "${php_bash_PID}" ] ; then rm -rf ${php_bash_PID} echo "${date} remove php_kill pid" >> /tmp/php_status.log else echo "php kill is not running" >> /tmp/php_status.log fi } main(){ create_pid ps aux|grep php|grep D|grep -v grep > /tmp/php_D_ps.log echo "${date} PHP_D_NUM: $(wc -l /tmp/php_D_ps.log)" >> /tmp/php_D_num.log cat /tmp/php_D_ps.log|awk '/www/{print "kill -9 "$2}'|bash if [ $? == 0 ]; then remove_pid fi } main ```