00a95fda80
Registers {hostname}.home.dustin.coffee → host IP on boot via AdGuard Home API.
Deploy to any LXC/VM with ./install.sh — supports root (system service),
sudo user (system via sudo), and unprivileged user (systemd --user or crontab).
Files:
- adguard-register.sh — detects hostname+IP, idempotent create/update
- install.sh — deployment script with auto-detection of install method
- uninstall.sh — removes service and binary
- README.md — full documentation
Tested across 24 hosts (LXCs and VMs) on a 172.20.0.0/16 home lab network.
32 lines
922 B
Bash
Executable File
32 lines
922 B
Bash
Executable File
#!/bin/bash
|
|
# uninstall.sh — remove adguard-register from this host
|
|
# Run as root (or with sudo): ./uninstall.sh
|
|
|
|
set -euo pipefail
|
|
|
|
INSTALL_PATH="/usr/local/bin/adguard-register"
|
|
SERVICE_PATH="/etc/systemd/system/adguard-register.service"
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "ERROR: This script must be run as root (use sudo)"
|
|
exit 1
|
|
fi
|
|
|
|
echo "=== Uninstalling adguard-register ==="
|
|
|
|
# Stop and disable service (ignore errors if not installed)
|
|
systemctl stop adguard-register.service 2>/dev/null || true
|
|
systemctl disable adguard-register.service 2>/dev/null || true
|
|
rm -f "${SERVICE_PATH}"
|
|
systemctl daemon-reload
|
|
echo "→ Removed systemd service"
|
|
|
|
# Remove script
|
|
rm -f "${INSTALL_PATH}"
|
|
echo "→ Removed ${INSTALL_PATH}"
|
|
|
|
echo ""
|
|
echo "=== Uninstall complete ==="
|
|
echo "NOTE: Existing DNS rewrites in AdGuard Home were NOT removed."
|
|
echo "To clean up entries, use the AdGuard Home web UI or API directly."
|