diff --git a/scripts/netcore/install.sh b/scripts/netcore/install.sh index 436f333..6d0f587 100644 --- a/scripts/netcore/install.sh +++ b/scripts/netcore/install.sh @@ -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" 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 -until [ -S /var/run/brov-netctl.sock ] || [ $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 +until running || [ $i -ge 20 ]; do sleep 0.5; i=$((i+1)); done +if running; then echo "✓ Ядро и помощник работают." else echo "⚠ Что-то не поднялось. Логи: /Library/Logs/BroV/"