fix: make SparkFun removal and launchd bootstrap non-fatal under set -e
networksetup -removenetworkservice fails on the sole PPP-port service and aborted the whole run at exit 4 (before pmset/backup agent). Both it and the GUI-domain launchctl bootstrap (flaky over SSH) are now best-effort with a warn; the LaunchAgent plist auto-loads at next login regardless. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ Do these once, in order, after `scripts/run.sh` has completed. Tick and date.
|
|||||||
- [ ] System Settings > Screen Time: App & Website Activity OFF.
|
- [ ] System Settings > Screen Time: App & Website Activity OFF.
|
||||||
- [ ] System Settings > Spotlight: untick Siri Suggestions and any web/store result types; "Help Apple Improve Search" OFF.
|
- [ ] System Settings > Spotlight: untick Siri Suggestions and any web/store result types; "Help Apple Improve Search" OFF.
|
||||||
- [ ] System Settings > Notifications: Allow notifications when mirroring/sharing OFF (keeps popups off a projector).
|
- [ ] System Settings > Notifications: Allow notifications when mirroring/sharing OFF (keeps popups off a projector).
|
||||||
|
- [ ] System Settings > Network: delete the stray **SparkFun Pro Micro** service if present (setup.sh can't — macOS refuses to remove the sole service on a PPP port). Harmless if left.
|
||||||
|
|
||||||
## DAW Focus
|
## DAW Focus
|
||||||
- [ ] System Settings > Focus > "+" > Custom > name **DAW**, icon of your choice. Allowed notifications: none. "Share across devices" OFF. Toggle it from the menu-bar moon before a session.
|
- [ ] System Settings > Focus > "+" > Custom > name **DAW**, icon of your choice. Allowed notifications: none. "Share across devices" OFF. Toggle it from the menu-bar moon before a session.
|
||||||
|
|||||||
+13
-3
@@ -112,9 +112,15 @@ if [[ "$dock_cur" == "${dock_want[*]} " ]]; then log skip "dock apps"; else
|
|||||||
log set "dock apps = ${dock_want[*]}"; CHANGED=1
|
log set "dock apps = ${dock_want[*]}"; CHANGED=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ---------- stray network service ----------
|
# ---------- stray network service (best-effort; never fatal) ----------
|
||||||
|
# macOS refuses -removenetworkservice for the sole service on a PPP port ("parameters were not
|
||||||
|
# valid"), so this may not remove it. It's a harmless disconnected entry — warn and move on.
|
||||||
if networksetup -listallnetworkservices | grep -qx 'SparkFun Pro Micro'; then
|
if networksetup -listallnetworkservices | grep -qx 'SparkFun Pro Micro'; then
|
||||||
sudo networksetup -removenetworkservice 'SparkFun Pro Micro'; log set "removed SparkFun Pro Micro PPP service"; CHANGED=1
|
if sudo networksetup -removenetworkservice 'SparkFun Pro Micro' 2>/dev/null; then
|
||||||
|
log set "removed SparkFun Pro Micro PPP service"; CHANGED=1
|
||||||
|
else
|
||||||
|
log warn "could not remove SparkFun PPP service (macOS refuses; harmless — remove via Settings > Network if desired)"
|
||||||
|
fi
|
||||||
else log skip "no SparkFun service"; fi
|
else log skip "no SparkFun service"; fi
|
||||||
|
|
||||||
# ---------- power (DAW) — AC profile only ----------
|
# ---------- power (DAW) — AC profile only ----------
|
||||||
@@ -130,7 +136,11 @@ PL="$HOME/Library/LaunchAgents/xyz.sethpc.mac-backup.plist"
|
|||||||
if [[ -f $PL ]] && cmp -s "$REPO/config/xyz.sethpc.mac-backup.plist" "$PL"; then log skip "backup launchd agent"; else
|
if [[ -f $PL ]] && cmp -s "$REPO/config/xyz.sethpc.mac-backup.plist" "$PL"; then log skip "backup launchd agent"; else
|
||||||
mkdir -p "$HOME/Library/LaunchAgents"; cp "$REPO/config/xyz.sethpc.mac-backup.plist" "$PL"
|
mkdir -p "$HOME/Library/LaunchAgents"; cp "$REPO/config/xyz.sethpc.mac-backup.plist" "$PL"
|
||||||
launchctl bootout "gui/$(id -u)/xyz.sethpc.mac-backup" 2>/dev/null || true
|
launchctl bootout "gui/$(id -u)/xyz.sethpc.mac-backup" 2>/dev/null || true
|
||||||
launchctl bootstrap "gui/$(id -u)" "$PL"; log set "backup launchd agent (03:30 nightly)"; CHANGED=1
|
# bootstrap into the GUI domain is flaky over SSH (no bound Aqua session); the plist in
|
||||||
|
# ~/Library/LaunchAgents auto-loads at next login regardless, so never let this abort setup.
|
||||||
|
if launchctl bootstrap "gui/$(id -u)" "$PL" 2>/dev/null; then log set "backup launchd agent loaded (03:30 nightly)"
|
||||||
|
else log warn "backup agent copied; bootstrap-over-SSH failed (normal) — loads at next login"; fi
|
||||||
|
CHANGED=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ---------- apply ----------
|
# ---------- apply ----------
|
||||||
|
|||||||
Reference in New Issue
Block a user