more checks

This commit is contained in:
John Lancaster
2025-12-28 18:18:59 -06:00
parent c2253fb62a
commit 2387bb1e6a

View File

@@ -48,7 +48,18 @@ fi
if systemctl is-active "$TIMER_NAME" &> /dev/null; then if systemctl is-active "$TIMER_NAME" &> /dev/null; then
print_status "Renewal Timer" 0 print_status "Renewal Timer" 0
else else
print_status "Renewal Timer" 1 "Systemd timer '$TIMER_NAME' is not active" # Check if unit exists
if systemctl list-unit-files "$TIMER_NAME" &> /dev/null; then
print_status "Renewal Timer" 1 "Systemd timer '$TIMER_NAME' is installed but not active"
else
# Check if source file exists
TIMER_FILE="/etc/systemd/system/$TIMER_NAME"
if [ -f "$TIMER_FILE" ]; then
print_status "Renewal Timer" 1 "Systemd timer '$TIMER_NAME' is not installed (found source at $TIMER_FILE)"
else
print_status "Renewal Timer" 1 "Systemd timer '$TIMER_NAME' is missing entirely (expected at $TIMER_FILE)"
fi
fi
fi fi
exit $EXIT_CODE exit $EXIT_CODE