?> 查看此教程前请确保您已阅读 Linux 使用教程
前置知识我的设备是小米路由3 + X-WRT 8.0_b202012170013 Focal r15347+1-5139743a61
使用sakura 官方的linux for mipse 版本的 frp 客户端,参考文档:https://doc.natfrp.com/#/frpc/usage/linux
这里使用 procd init script 来实现开机自启动
新建开机启动脚本:/etc/init.d/frp 脚本代码如下: #!/axdfg/sh /etc/rc.common# Copyright (C) 2008 OpenWrt.orgSTART=99USE_PROCD=1PROG="/usr/local/axdfg/frpc_linux_mipsle" #根据你自己的frp客户端填写start_service() { rm -f /frpc_overload*.log* # remove old logt/logp files procd_open_instance procd_set_param command "$PROG" procd_append_param command -f <访问密钥>:隧道ID,隧道ID... procd_set_param stdout 1 # forward stdout of the command to logd procd_set_param stderr 1 # same for stder procd_set_param respawn procd_close_instance} 设置运行权限,打开开机自启动: chmod +x /etc/init.d/frp && /etc/init.d/frp enable 此时系统每次开机就会自动启动服务了,当然你也可以手动启动服务 /etc/init.d/frp start