Skip to content

Commit

Permalink
mod frpc sh
Browse files Browse the repository at this point in the history
  • Loading branch information
fightroad committed Oct 15, 2024
1 parent e21c4e8 commit 1beaf90
Showing 1 changed file with 11 additions and 40 deletions.
51 changes: 11 additions & 40 deletions trunk/user/frp/frp_script.sh
Original file line number Diff line number Diff line change
@@ -1,59 +1,30 @@
#!/bin/sh
#from hiboy
killall frpc frps
#创建运行环境
killall frpc
mkdir -p /tmp/frp
#启动frp功能后会运行以下脚本
#frp项目地址教程: https://github.com/fatedier/frp/blob/master/README_zh.md
#请自行修改 token 用于对客户端连接进行身份验证
# IP查询: http://119.29.29.29/d?dn=github.com

#创建frpc配置文件
cat > "/tmp/frp/myfrpc.ini" <<-\EOF
# ==========客户端配置:==========
[common]
server_addr = 1192.0.0.3
server_port = 7000
token = 12345
#log_file = /dev/null
#log_level = info
#log_max_days = 3
log_file = /tmp/frpc.log
log_level = info
log_max_days = 3
[web]
[test]
remote_port = 6000
type = http
type = tcp
local_ip = 192.168.2.1
local_port = 80
subdomain = test
#host_header_rewrite = 实际你内网访问的域名,可以供公网的域名不一致,如果一致可以不写
# ====================
# ================================
EOF

#请手动配置【外部网络 (WAN) - 端口转发 (UPnP)】开启 WAN 外网端口
cat > "/tmp/frp/myfrps.ini" <<-\EOF
# ==========服务端配置:==========
[common]
bind_port = 7000
dashboard_port = 7500
# dashboard 用户名密码,默认都为 admin
dashboard_user = admin
dashboard_pwd = admin
vhost_http_port = 88
token = 12345
subdomain_host = frps.com
max_pool_count = 50
#log_file = /dev/null
#log_level = info
#log_max_days = 3
# ====================
EOF

#启动:
#启动程序
frpc_enable=`nvram get frpc_enable`
frps_enable=`nvram get frps_enable`
if [ "$frpc_enable" = "1" ] ; then
frpc -c /tmp/frp/myfrpc.ini 2>&1 &
fi
if [ "$frps_enable" = "1" ] ; then
frps -c /tmp/frp/myfrps.ini 2>&1 &
fi

fi

0 comments on commit 1beaf90

Please sign in to comment.