forked from mtusi2026/mtusi2026lab7
9 lines
440 B
Bash
Executable File
9 lines
440 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
root="$PWD"
|
|
command -v crontab >/dev/null || { echo 'Install cron before enabling host certificate renewal.' >&2; exit 1; }
|
|
(crontab -l 2>/dev/null | sed '\|# lab7-pki-renew$|d' || true
|
|
printf '0 */12 * * * cd %q && scripts/renew-pki.sh >> secrets/operator/renewal.log 2>&1 # lab7-pki-renew\n' "$root") | crontab -
|
|
echo 'Installed operator certificate renewal every 12 hours.'
|