Openwrt 自动运行 Frp Server 脚本

# Download
FD=`ls /tmp | grep frps$`
if [ "$FD" != "" ]; then
echo \[$(date)\] frps exists! >> /tmp/frps.log
else
wget https://pan.lod.pub/tmp/frps -O /tmp/frps
chmod 777 /tmp/frps
echo \[$(date)\] frps binary is downloaded! >> /tmp/frps.log
fi

# Verify the binary file
MD5=`md5sum /tmp/frps | awk '{print $1}'`
if [ $MD5 != "482396c262bcf4fdf8c04dc081ab267f" ]; then
echo "Invalid binary file! Delete and Download again!" >> /tmp/frps.log
rm /tmp/frps
wget https://pan.lod.pub/tmp/frps -O /tmp/frps
chmod 777 /tmp/frps
else
echo "Binary verification passed!" >> /tmp/frps.log
fi

# Run
PIDS=`ps | grep ./frps | grep frps.ini | awk '{print $1}'`
if [ "$PIDS" != "" ]; then
echo \[$(date)\] frp server is runing! >> /tmp/frps.log
else
screen -wipe 
screen -dmS frps /tmp/frps -c /root/frps.ini
echo \[$(date)\] Frp server start! >> /tmp/frps.log
fi

在系统-计划任务中添加 */10 * * * * /root/autoFrps.sh

本文链接:

https://lod.pub/auto-run-frp-server-in-openwrt.html
1 + 6 =
快来做第一个评论的人吧~