#!/bin/bash

# 首先检查参数是否正确
if [ $# -ne 2 ]; then
    echo "Usage: $0 <local_port> <remote_port>"
    exit 1
fi

# 保存参数到变量
local_port=$1
remote_port=$2

# 添加新配置到文件
cat <<EOF >> /frpc/frpc.toml
[${local_port}${remote_port}]
type = tcp
local_ip = 127.0.0.1
local_port = $local_port
remote_port = $remote_port
EOF

echo "New configuration added to /frpc/frpc.toml"
