fix: add option to restart service, not only reload

This commit is contained in:
Ruben Solvang 2025-05-07 14:41:02 +02:00
parent 5c706ba5d4
commit df83b8aa59

View file

@ -222,11 +222,13 @@ process_certificates() {
# Reload service if needed
if [ $service_reloaded -eq 1 ]; then
echo -e "${BLUE}Reloading $SERVICE_NAME service...${NC}"
echo -e "${BLUE}Reloading/restarting $SERVICE_NAME service...${NC}"
if systemctl reload "$SERVICE_NAME"; then
echo -e "${GREEN}Service reloaded successfully${NC}"
elif systemctl restart "$SERVICE_NAME"; then
echo -e "${GREEN}Service restarted successfully${NC}"
else
echo -e "${RED}Failed to reload service${NC}"
echo -e "${RED}Failed to reload or restart service${NC}"
return 1
fi
fi