This commit is contained in:
Olia Lisa 2026-01-10 21:13:57 +08:00
parent d712af249b
commit 80e3e3f1a6

View File

@ -19,9 +19,15 @@ update_domain(){
exit 1 exit 1
fi fi
# 修改域名 # 修改server_name
modify_json_file "$config_file" ".inbounds[0].tls.server_name" "$domain" modify_json_file "$config_file" ".inbounds[0].tls.server_name" "$domain"
# 是否存在acme域名, 存在则修改
local acme_exists=$(jq -r 'has("inbounds") and (.inbounds[0] | has("tls")) and (.inbounds[0].tls | has("acme"))' "$config_file")
if [[ "$acme_exists" == "true" ]]; then
modify_json_file "$config_file" ".inbounds[0].tls.acme.domains[0]" "$domain"
fi
echo "修改域名成功" echo "修改域名成功"
} }