This commit is contained in:
2026-05-18 22:32:08 +08:00
parent 6ab44ea187
commit bd4caa0f09
22 changed files with 1178 additions and 297 deletions

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env sh
set -eu
# 卸载 scripts/install-renew-cron.sh 安装的证书自动续期定时任务。
# 只删除固定标记之间的内容,不影响其它 crontab 任务。
MARK_BEGIN="# BEGIN openresty-gateway cert renew"
MARK_END="# END openresty-gateway cert renew"
if ! command -v crontab >/dev/null 2>&1; then
echo "错误:缺少 crontab 命令。" >&2
exit 1
fi
tmp_file="$(mktemp)"
trap 'rm -f "$tmp_file"' EXIT
crontab -l 2>/dev/null | sed "/$MARK_BEGIN/,/$MARK_END/d" > "$tmp_file"
crontab "$tmp_file"
echo "已卸载证书续期 cron。"