diff --git a/bin/update_port.sh b/bin/update_port.sh index 6663964..2d1f6ea 100644 --- a/bin/update_port.sh +++ b/bin/update_port.sh @@ -88,10 +88,10 @@ update_port(){ } ask_update_port(){ - local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 脚本文件夹路径 + local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" local config_file="$script_dir/../conf/config.json" - local current_port=$(jq -r '.inbounds[0].port' $config_dir/config.json) - local new_port=ask_update "请输入新的端口号" "$current_port" - update_port $new_port -} + local current_port=$(jq -r '.inbounds[0].port' "$config_file") + local new_port=$(ask_update "请输入新的端口号" "$current_port") + update_port "$new_port" +} \ No newline at end of file