守护服务器上的frps自动重启

其他杂项26字数 360阅读1分12秒阅读模式

服务器上的FRPS服务老是自己断了,找了个脚本守护一下。

#!/bin/bash
if curl -I "nas.fangfa.me:5555" 2>&1 | grep -w "200";
then
    echo "nas.fangfa.me:5555 is GOOD"
else
    echo "nas.fangfa.me:5555 is BAD"
    echo $(date +%T%n%F)" Restart Frps Services " >> restartfrps.log
    systemctl restart frps
    echo "restart frps success"
fi

另存为shouhufrp.sh,然后添加crontab任务

* * * * * sh /root/shouhufrp.sh

 
  • 本文由 asdfasd 发表于 2025-02-1710:35:08
  • 转载请务必保留本文链接:http://wp.fangfa.me/other-note/%e5%ae%88%e6%8a%a4%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e7%9a%84frps%e8%87%aa%e5%8a%a8%e9%87%8d%e5%90%af.html