Files
common-server-public/acme/install.sh
张威33321 a9ec40a289 0908
2026-09-09 15:04:54 +08:00

26 lines
758 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
#
# 安装 acme.sh纯 Shell ACME 客户端,不依赖 Python / 容器 / snap
#
set -euo pipefail
EMAIL="${EMAIL:-admin@stonelan.cn}"
ACME="${ACME:-$HOME/.acme.sh/acme.sh}"
if [ -s "$ACME" ]; then
echo "acme.sh 已安装:$ACME"
else
echo "==> 安装 acme.sh"
curl https://get.acme.sh | sh -s email="$EMAIL"
fi
# acme.sh 3.x 默认 CA 是 ZeroSSL这里显式固定为 Let's Encrypt
"$ACME" --set-default-ca --server letsencrypt
echo "==> acme.sh 就绪"
"$ACME" --version
# 安装脚本会自动写入一条 cron每天执行 acme.sh --cron无需再手配续签
echo "==> 已注册的 cron"
crontab -l 2>/dev/null | grep acme.sh || echo " (未找到,请手动添加,参考 crontab.example"