Files
computer-playbook/scripts/dns/remove.sh
T
kevinveenbirkenbach 6c84807778 feat(test-local): add all-app inventory init and run targets
Add two local test helpers to run full-stack deployments for all discovered apps:

- make test-local-inventory-init-all: bring up dev stack and create inventory
  (/etc/inventories/local-full-<type>/servers.yml) including all apps
- make test-local-run-all: run deploy using the pre-initialized inventory

Also mark various scripts as executable (chmod +x) to ensure consistent
behavior across environments.

https://chatgpt.com/share/6970018e-1244-800f-9345-ca1596061729
2026-01-20 23:43:10 +01:00

29 lines
808 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
DOMAIN="infinito.example"
NM_CONF="/etc/NetworkManager/conf.d/00-infinito-dnsmasq.conf"
NM_DNSMASQ_CONF="/etc/NetworkManager/dnsmasq.d/${DOMAIN}.conf"
SYS_DNSMASQ_CONF="/etc/dnsmasq.d/${DOMAIN}.conf"
echo ">>> Removing local DNS for *.${DOMAIN}"
# Remove NetworkManager dnsmasq setup
if systemctl is-active --quiet NetworkManager 2>/dev/null; then
echo ">>> NetworkManager active -> removing NM dnsmasq config"
sudo rm -f "${NM_CONF}" "${NM_DNSMASQ_CONF}"
sudo systemctl restart NetworkManager
fi
# Remove system dnsmasq snippet (fallback setup)
sudo rm -f "${SYS_DNSMASQ_CONF}" || true
# If system dnsmasq is active, restart to apply
if systemctl is-active --quiet dnsmasq 2>/dev/null; then
sudo systemctl restart dnsmasq || true
fi
echo ">>> Removed."