install.sh: wait for both services before reporting (no false alarm)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maksarsanjeev
2026-10-08 01:40:42 +03:00
parent a7a0195d34
commit 9e02402555
+8 -2
View File
@@ -129,9 +129,15 @@ for label in "$CORE_LABEL" "$CTL_LABEL"; do
launchctl bootstrap system "/Library/LaunchDaemons/$label.plist" 2>/dev/null || launchctl kickstart -k "system/$label" launchctl bootstrap system "/Library/LaunchDaemons/$label.plist" 2>/dev/null || launchctl kickstart -k "system/$label"
done done
# Services take a moment to start: wait up to 10 s before judging.
running() {
launchctl print "system/$CORE_LABEL" 2>/dev/null | grep -q 'state = running' &&
launchctl print "system/$CTL_LABEL" 2>/dev/null | grep -q 'state = running' &&
[ -S /var/run/brov-netctl.sock ]
}
i=0 i=0
until [ -S /var/run/brov-netctl.sock ] || [ $i -ge 20 ]; do sleep 0.5; i=$((i+1)); done until running || [ $i -ge 20 ]; do sleep 0.5; i=$((i+1)); done
if launchctl print "system/$CORE_LABEL" | grep -q 'state = running' && [ -S /var/run/brov-netctl.sock ]; then if running; then
echo "✓ Ядро и помощник работают." echo "✓ Ядро и помощник работают."
else else
echo "⚠ Что-то не поднялось. Логи: /Library/Logs/BroV/" echo "⚠ Что-то не поднялось. Логи: /Library/Logs/BroV/"