health-check.sh: check hub user's crontab instead of root's when running as root

This commit is contained in:
Justin Oros
2026-04-19 22:36:46 -07:00
parent 92a2af8c5c
commit a8b10a1814

View File

@@ -190,7 +190,7 @@ check_hub() {
fail "rclone remote [${spoke_name}-remote] not found in rclone.conf"
fi
if crontab -l 2>/dev/null | grep -q "${spoke_name}-remote:"; then
if crontab -u "$(basename "$HUB_HOME")" -l 2>/dev/null | grep -q "${spoke_name}-remote:"; then
ok "Auto-mount crontab entry present"
else
warn "No auto-mount crontab entry for $spoke_name"