#!/usr/bin/env bash # One-time install of the yaris-obd WiFi hotspot <-> home-WiFi auto-switch # watcher on the Pi. Run this ON THE PI as the `yaris` user (needs sudo): # cd /home/yaris/app/yaris-obd && bash deploy/install_netwatch.sh # # Prerequisite: the "home-wifi" (home WiFi) and "Hotspot" (AP mode) NetworkManager # connection profiles must already exist (see PLAN.md Phase 6 for the nmcli # commands used to create them) with home-wifi having a higher # connection.autoconnect-priority than Hotspot. set -euo pipefail REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" sudo install -m 755 "$REPO_DIR/deploy/yaris-netwatch.sh" /usr/local/bin/yaris-netwatch.sh sudo cp "$REPO_DIR/deploy/yaris-netwatch.service" /etc/systemd/system/yaris-netwatch.service sudo cp "$REPO_DIR/deploy/yaris-netwatch.timer" /etc/systemd/system/yaris-netwatch.timer sudo systemctl daemon-reload sudo systemctl enable --now yaris-netwatch.timer echo "Done. Check status with: systemctl status yaris-netwatch.timer" echo "Logs: journalctl -t yaris-netwatch -f"