Files
anorandClaude Opus 4.7 910931129a chore: синхронизация с live + install.sh для воспроизводимого деплоя
- set_static_routes.sh обновлён до текущего /usr/local/bin (1 → 13 маршрутов:
  netherlands/netherlands2, finland/finland2, PL VPS, Moscow, LAN, mgcgroup)
- install.sh: sudo-деплой скрипта + LaunchDaemon в системные пути,
  устраняет ручной cp и расхождение репо ↔ /usr/local/bin

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 17:36:24 +10:00

31 lines
1.4 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Deploy macOS static-routes daemon from this repo to live system paths.
# Run: sudo bash install.sh
#
# Источник правды для статических маршрутов мимо VPN на этом Маке — ЭТОТ репо.
# Демон com.custom.staticroutes гоняет /usr/local/bin/set_static_routes.sh каждые 5с.
# Раньше /usr/local/bin правился вручную и расходился с git — install.sh это чинит.
set -eu
SRC="$(cd "$(dirname "$0")" && pwd)"
if [[ "$(id -u)" != "0" ]]; then
echo "Нужен root. Запусти: sudo bash $0"
exit 1
fi
echo "=== Deploy static-routes daemon ==="
install -m 755 -o root -g wheel "$SRC/set_static_routes.sh" /usr/local/bin/set_static_routes.sh
echo " -> /usr/local/bin/set_static_routes.sh"
install -m 644 -o root -g wheel "$SRC/com.custom.staticroutes.plist" /Library/LaunchDaemons/com.custom.staticroutes.plist
echo " -> /Library/LaunchDaemons/com.custom.staticroutes.plist"
launchctl unload /Library/LaunchDaemons/com.custom.staticroutes.plist 2>/dev/null || true
launchctl load -w /Library/LaunchDaemons/com.custom.staticroutes.plist
echo " -> daemon (re)loaded"
echo "=== Done. Демон применит маршруты в течение 5с. ==="
echo "Проверка: route -n get <VPS-IP> → gateway 192.168.87.1 / interface en0 (не utun)"