Pārlūkot izejas kodu

fix: use robust systemd service detection in updater

uefigs139 3 mēneši atpakaļ
vecāks
revīzija
78f17614e7
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      install/update.sh

+ 2 - 1
install/update.sh

@@ -108,7 +108,8 @@ if [ -z "$BRANCH" ]; then
   [ "$BRANCH" = "HEAD" ] && BRANCH="main"
 fi
 
-if ! systemctl list-unit-files --type=service | grep -q "^${SERVICE_NAME}\.service"; then
+load_state="$(systemctl show "$SERVICE_NAME" --property=LoadState --value 2>/dev/null || true)"
+if [ -z "$load_state" ] || [ "$load_state" = "not-found" ]; then
   die "Service not found: ${SERVICE_NAME}.service"
 fi