VMs/stopnat.sh
2025-07-21 12:50:10 +00:00

18 lines
337 B
Bash
Executable File

#!/bin/bash
if [ "$EUID" != 0 ]; then
echo "this script must be run as root" >&2
exit
fi
ip link del dev "${1-virbr0}"
nft destroy table qemu
if [ -f /tmp/restore-nft.conf ]; then
nft -f /tmp/restore-nft.conf
rm /tmp/restore-nft.conf
fi
kill -TERM "$(< /var/run/dnsmasq-virbr0.pid)"
rm -f /var/run/dnsmasq-virbr0.pid