1 Star 0 Fork 4

root / shell

forked from 冰羽... / shell 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
frpc.sh 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
冰羽... 提交于 2020-03-06 10:27 . 初始化
#/bin/bash
Dir=/usr/local/frp
yum -y install wget
mkdir -p $Dir && cd $Dir
wget http://mirror.cnop.net/frp/frp_0.13.0_linux_amd64.tar.gz
tar -zxvf frp_0.13.0_linux_amd64.tar.gz && rm -rf frp_0.13.0_linux_amd64.tar.gz
mv $Dir/frp_0.13.0_linux_amd64/* ./ && rm -rf $Dir/frp_0.13.0_linux_amd64
cd $Dir && rm -rf frps frps.ini
#/bin/bash
echo "
[common]
server_addr = 23.105.195.x
server_port = 7000
[ssh]
type = tcp
local_ip = 192.168.20.126
local_port = 22
remote_port = 6000
[web]
type = http
local_port = 8181
custom_domains = vpn.xrk.org
[mysql]
type = tcp
local_port = 3307
remote_port = 13306
">$Dir/frpc.ini
echo "Please input the service ip:"
read s_ip
sed -i "s@23.105.195.x@$s_ip@g" $Dir/frpc.ini
echo "Please input the local addr:"
read l_ip
sed -i "s@192.168.20.126@$l_ip@g" $Dir/frpc.ini
echo "Please input the mysql port:"
read mysql_port
sed -i "s@3307@$mysql_port@g" $Dir/frpc.ini
echo "Please input the web port:"
read web_port
sed -i "s@8181@$web_port@g" $Dir/frpc.ini
echo "
[Unit]
Description=FRP Client Daemon
After=network.target
Wants=network.target
[Service]
Type=simple
ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.ini
Restart=always
RestartSec=20s
User=nobody
[Install]
WantedBy=multi-user.target
" > /etc/systemd/system/frpc.service
echo "start frpc:"
systemctl daemon-reload && systemctl start frpc && systemctl enable frpc
echo "Done"
Shell
1
https://gitee.com/wjbjwang/shell.git
git@gitee.com:wjbjwang/shell.git
wjbjwang
shell
shell
master

搜索帮助