#!/bin/bash # # Written by an LLM (Claude Code) — review before trusting on a machine # other than the one this was diagnosed on. See README.md. # # Removes everything install.sh set up: the timer, service, script, # optional config override, and the ip rule itself. # # Usage: sudo ./uninstall.sh set -euo pipefail if [ "$(id -u)" -ne 0 ]; then echo "Must be run as root (sudo ./uninstall.sh)" >&2 exit 1 fi systemctl disable --now docker-tailscale-route.timer 2>/dev/null || true rm -f /etc/systemd/system/docker-tailscale-route.timer rm -f /etc/systemd/system/docker-tailscale-route.service rm -f /usr/local/sbin/docker-tailscale-route.sh rm -f /etc/default/docker-tailscale-route systemctl daemon-reload DOCKER_SUBNET="172.16.0.0/12" TARGET_TABLE="main" if ip rule list | grep -q "from ${DOCKER_SUBNET} lookup ${TARGET_TABLE}"; then ip rule del from "$DOCKER_SUBNET" lookup "$TARGET_TABLE" fi echo "Uninstalled."