This commit is contained in:
Your Name
2025-05-23 16:22:32 +02:00
parent 8fdd1d6ac5
commit b93f205fd4

View File

@@ -79,12 +79,17 @@ services=(
for service in "${services[@]}"; do for service in "${services[@]}"; do
if systemctl list-unit-files | grep -q "$service"; then if systemctl list-unit-files | grep -q "$service"; then
print_status "Restarting service: $service" # Check if service is enabled before restarting
if systemctl is-enabled --quiet "$service" 2>/dev/null; then
print_status "Restarting enabled service: $service"
sudo systemctl restart "$service" sudo systemctl restart "$service"
if systemctl is-active --quiet "$service"; then if systemctl is-active --quiet "$service"; then
print_status "$service is running" print_status "$service is running"
else else
print_status "$service may not be active" print_status "$service failed to start"
fi
else
print_status " Service $service is disabled, skipping restart"
fi fi
else else
print_status " Service $service not found (may not be installed)" print_status " Service $service not found (may not be installed)"