重构代码
This commit is contained in:
parent
745e09c77f
commit
bb01321871
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
update_realty_dest(){
|
||||||
script_dir=$(cd "$(dirname "$0")"; pwd)
|
script_dir=$(cd "$(dirname "$0")"; pwd)
|
||||||
config_dir="$script_dir/../conf"
|
config_dir="$script_dir/../conf"
|
||||||
source $script_dir/utils/jq_util.sh
|
source $script_dir/utils/jq_util.sh
|
||||||
@ -22,9 +24,6 @@ fi
|
|||||||
|
|
||||||
domain=$(echo "$dest" | awk -F ':' '{print $1}')
|
domain=$(echo "$dest" | awk -F ':' '{print $1}')
|
||||||
|
|
||||||
|
|
||||||
echo "正在修改配置文件..."
|
|
||||||
|
|
||||||
# 修改配置文件的dest
|
# 修改配置文件的dest
|
||||||
modify_json_file "$config_dir/config.json" ".inbounds[0].streamSettings.realitySettings.dest" "$dest"
|
modify_json_file "$config_dir/config.json" ".inbounds[0].streamSettings.realitySettings.dest" "$dest"
|
||||||
|
|
||||||
@ -34,4 +33,4 @@ modify_json_file "$config_dir/config.json" ".inbounds[0].streamSettings.realityS
|
|||||||
echo "配置文件修改成功!"
|
echo "配置文件修改成功!"
|
||||||
echo "新的dest地址为: $dest"
|
echo "新的dest地址为: $dest"
|
||||||
echo "新的serverNames数组为: [\"$domain\"]"
|
echo "新的serverNames数组为: [\"$domain\"]"
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user