Openwrt开机自启frpc

警告
本文最后更新于 2024-05-18,文中内容可能已过时。

https://openwrt.org/docs/guide-developer/procd-init-script-example

cd /etc/init.d vim frpc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#!/bin/sh /etc/rc.common
START=99
STOP=90
SERVICE=frpc
USE_PROCD=1
PROC="/usr/bin/frpc -c /root/frpc/frpc.toml"
start_service(){
     procd_open_instance
     procd_set_param command $PROC
     procd_set_param respawn
     procd_close_instance
}
service_triggers()
{
        procd_add_reload_trigger "rpcd"
}

/etc/init.d/frp enable && echo on

0%