diff --git a/bin/update_port.sh b/bin/update_port.sh index f3fefec..39f68f4 100644 --- a/bin/update_port.sh +++ b/bin/update_port.sh @@ -156,6 +156,22 @@ port_manage() { fi } + +# ========================================== +# 更新 sing-box 配置文件中的监听端口,并开放对应防火墙规则 +# 参数1: 端口号(可选,不传则在指定范围内随机选取空闲端口) +# 参数2: 随机端口起始值(可选,默认 5000) +# 参数3: 随机端口结束值(可选,默认 15000) +# --- 使用示例 --- +# 指定端口 +# update_port 8080 +# +# 自动随机端口(默认范围 5000-15000) +# update_port +# +# 自动随机端口(自定义范围) +# update_port "" 20000 30000 +# ========================================== update_port(){ local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件夹绝对路径