Files
brov-macbook/scripts/netcore/uninstall.sh
T
maksarsanjeev 817c837f5a Net core: with capture on, the Mac's DNS goes into the core
The home router's DNS (192.168.10.1) doesn't answer; a LAN DNS server is reached around
the TUN, so with AmneziaVPN off nothing resolved. netctl now points every network service
at 198.18.0.2 (hijacked inside the TUN) when capture is on, restores the previous servers
when it goes off, and syncs this at boot. uninstall.sh puts DNS back too.
Adds scripts/netcore/diag.sh (one-minute TUN diagnosis, run by hand with sudo).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 00:25:54 +03:00

22 lines
1.1 KiB
Bash

#!/bin/sh
# Removes the BroV network core services (sudo sh scripts/netcore/uninstall.sh).
# Keys stay in /Library/Application Support/BroV/netcore unless you pass --purge.
# After this the Mac goes online by itself; turn AmneziaVPN back on if needed.
set -e
[ "$(id -u)" -eq 0 ] || { echo "Запусти через sudo: sudo sh $0"; exit 1; }
# DNS pointed into the core goes back to automatic.
networksetup -listallnetworkservices | tail -n +2 | grep -v '^\*' | while read -r svc; do
[ "$(networksetup -getdnsservers "$svc")" = "198.18.0.2" ] && networksetup -setdnsservers "$svc" Empty
done
for label in local.maksar.brov.netctl local.maksar.brov.netd; do
launchctl bootout "system/$label" 2>/dev/null || true
rm -f "/Library/LaunchDaemons/$label.plist"
done
rm -f /var/run/brov-netctl.sock
if [ "$1" = "--purge" ]; then
rm -rf "/Library/Application Support/BroV" /Library/Logs/BroV
echo "✓ Службы, ядро и ключи удалены."
else
echo "✓ Службы ядра BroV остановлены и удалены. Ключи остались в /Library/Application Support/BroV/netcore (root)."
fi