fix: use systemctl cat instead of list-units for reliable service detection

This commit is contained in:
root
2026-06-06 16:24:44 +02:00
parent 4c085ac7eb
commit 434f58d5aa
2 changed files with 3 additions and 3 deletions
View File
+3 -3
View File
@@ -198,7 +198,7 @@ fi
# ---------------------------------------- # ----------------------------------------
# 7. Restart the Service # 7. Restart the Service
# ---------------------------------------- # ----------------------------------------
if systemctl list-units --type=service --all 2>/dev/null | grep -q "$EMULATOR_SERVICE.service"; then if systemctl cat "$EMULATOR_SERVICE" &>/dev/null; then
echo "--> Restarting $EMULATOR_SERVICE service..." echo "--> Restarting $EMULATOR_SERVICE service..."
if command -v sudo &> /dev/null; then if command -v sudo &> /dev/null; then
sudo systemctl restart "$EMULATOR_SERVICE" sudo systemctl restart "$EMULATOR_SERVICE"
@@ -220,7 +220,7 @@ echo "--> Running extra validation..."
ERRORS=0 ERRORS=0
# Check build output exists # Check build output exists
if [ -d "$NITRO_CLIENT/public/assets" ]; then if [ -d "$NITRO_CLIENT/dist/assets" ]; then
echo "--> [OK] Nitro-V3 build assets found" echo "--> [OK] Nitro-V3 build assets found"
else else
echo "--> [FAIL] Nitro-V3 build assets missing!" echo "--> [FAIL] Nitro-V3 build assets missing!"
@@ -242,7 +242,7 @@ for dir in "$NITRO_CLIENT" "$NITRO_RENDERER" "$EMULATOR_DIR" "$GAMEDATA_CONF_DIR
done done
# Check if emulator service is running # Check if emulator service is running
if systemctl list-units --type=service --all 2>/dev/null | grep -q "$EMULATOR_SERVICE.service"; then if systemctl cat "$EMULATOR_SERVICE" &>/dev/null; then
SERVICE_STATUS=$(systemctl is-active "$EMULATOR_SERVICE" 2>/dev/null || echo "unknown") SERVICE_STATUS=$(systemctl is-active "$EMULATOR_SERVICE" 2>/dev/null || echo "unknown")
if [ "$SERVICE_STATUS" = "active" ]; then if [ "$SERVICE_STATUS" = "active" ]; then
echo "--> [OK] $EMULATOR_SERVICE service is $SERVICE_STATUS" echo "--> [OK] $EMULATOR_SERVICE service is $SERVICE_STATUS"