Files
timmy-config/bin/hotspot-keepalive.sh
Alexander Whitestone d4c79d47a6 feat: add operational scripts and deploy.sh
- Moved all agent loop scripts into source control (bin/)
- claude-loop.sh, gemini-loop.sh, timmy-orchestrator.sh
- workforce-manager.py, agent-dispatch.sh, nexus-merge-bot.sh
- ops dashboard scripts (ops-panel, ops-helpers, ops-gitea)
- monitoring scripts (timmy-status, timmy-loopstat)
- deploy.sh: one-command overlay onto ~/.hermes/
- Updated README with sidecar architecture docs
- All loops now target the-nexus + autolora only
2026-03-25 10:05:55 -04:00

37 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# hotspot-keepalive.sh — Auto-reconnect to Alfred hotspot
# Checks every 30s, reconnects if dropped.
SSID="Alfred"
IFACE="en0"
LOG="$HOME/.hermes/logs/hotspot.log"
CHECK_INTERVAL=30
log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] HOTSPOT: $*" >> "$LOG"; }
log "=== Keepalive started for SSID: $SSID ==="
while true; do
current=$(networksetup -getairportnetwork "$IFACE" 2>/dev/null | sed 's/.*: //')
if [ "$current" = "$SSID" ]; then
# Connected — check we actually have internet
if ! ping -c 1 -W 3 8.8.8.8 >/dev/null 2>&1; then
log "Connected to $SSID but no internet — forcing reconnect"
networksetup -setairportnetwork "$IFACE" "$SSID" 2>/dev/null
fi
else
log "Not on $SSID (current: ${current:-none}) — reconnecting..."
networksetup -setairportnetwork "$IFACE" "$SSID" 2>/dev/null
sleep 5
new=$(networksetup -getairportnetwork "$IFACE" 2>/dev/null | sed 's/.*: //')
if [ "$new" = "$SSID" ]; then
log "Reconnected to $SSID"
else
log "FAILED to reconnect (got: ${new:-none}) — retrying in ${CHECK_INTERVAL}s"
fi
fi
sleep "$CHECK_INTERVAL"
done