Refactor service name extraction in casaos-healthcheck run.sh

This commit is contained in:
Christopher
2024-02-29 10:03:15 -06:00
parent 33f7173604
commit dbf734ac8a

View File

@@ -58,7 +58,7 @@ else
fi
# Get a list of all casaos services
SERVICES=$(systemctl list-units --type=service | grep "$SERVICE_PREFIX" | awk '{print $1}' | grep -v '[^ -~]')
SERVICES=$(systemctl list-units --type=service | grep "$SERVICE_PREFIX" | sed 's/^[[:space:]]*●[[:space:]]*//' | grep -oP '\S+\.service')
# Check if any services were found
if [[ -z "$SERVICES" ]]; then