OpenWrt学习之路(3)openwrt路由器(GL-XE300)frp自启动

硬件介绍

品牌:GL·iNet 型号:GL-XE300

软件介绍

OpenWrt 版本检查命令
root@GL-XE300:~# cat /etc/banner
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.8, r11364-ef56c85848
 -----------------------------------------------------
查看openwrt内核版本
root@GL-XE300:~# cat /proc/version
Linux version 4.14.241 (glinet@ubuntu) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11257-5090152ae3)) #0 Thu Jul 29 19:50:28 2021

目录:

root@GL-XE300:~# cd /usr/local/frp/
root@GL-XE300:/usr/local/frp# ll
drwxr-xr-x    2 root     root           544 Oct 28 17:25 ./
drwxr-xr-x    3 root     root           224 Oct 28 13:44 ../
-rwxr-xr-x    1 root     root           834 Oct 28 14:16 cn-ah-dx-2.natfrp.cloud.crt*
-rwxr-xr-x    1 root     root           887 Oct 28 14:16 cn-ah-dx-2.natfrp.cloud.key*
-rwxr-xr-x    1 root     root       4057784 Oct 28 13:44 frpc*
-rwxrwxrwx    1 777      root           168 Oct 28 17:25 restart-80801*

程序关闭自启动脚本

root@GL-XE300:/usr/local/frp# cat restart-80801 
#!/bin/sh /etc/rc.common

ps | grep frpc | grep -v grep
if [ $? -ne 0 ]
then
/usr/local/frp/frpc  -f xxxxxxxxxxxxxxxxx:xxxxxxxxx  & 
else
echo "runing"

fi

自启动计划任务,需要重启生效

root@GL-XE300:/usr/local/frp# crontab  -l
*/5 * * * *  sh /usr/local/frp/restart-80801 &

单独访问地址:https://xxx.xxx.xxx.xxx:xxxx/

posted @ 2022-10-28 18:12  muzlei  阅读(369)  评论(0)    收藏  举报