fix: reuse existing Caddy binary and preserve Caddyfile on install
Main / build (push) Waiting to run

This commit is contained in:
2026-07-07 23:47:56 +08:00
parent 906ee96282
commit a3e048b949
3 changed files with 18 additions and 6 deletions
+9 -4
View File
@@ -1293,13 +1293,18 @@ get() {
is_host_dns=$(_wget -qO- --header="accept: application/dns-json" "https://one.one.one.one/dns-query?name=$host&type=$is_dns_type")
;;
install-caddy)
_green "\n安装 Caddy 实现自动配置 TLS.\n"
load download.sh
download caddy
if [[ -f $is_caddy_bin || $(type -P caddy) ]]; then
[[ ! -f $is_caddy_bin ]] && is_caddy_bin=$(type -P caddy)
_green "\n检测到系统已安装 Caddy (${is_caddy_bin}),将直接使用现有版本。\n"
else
_green "\n安装 Caddy 实现自动配置 TLS.\n"
load download.sh
download caddy
fi
load systemd.sh
install_service caddy &>/dev/null
is_caddy=1
_green "安装 Caddy 成功.\n"
_green "Caddy 配置成功.\n"
;;
reinstall)
is_install_sh=$(cat $is_sh_dir/install.sh)