ansible_deploy/templates/usr/local/bin/run-dnsmasq-in-netns.sh.j2
GnomeZworc 429fa32be0
add dnsmasq
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-11-22 20:33:33 +01:00

21 lines
No EOL
477 B
Django/Jinja

#!/bin/bash
set -e
# Expects one argument: netns_bridge (e.g. vpc-00003_br-00002 or vpc1_br0)
arg="$1"
NETNS="${arg%%_*}"
BRIDGE="${arg#*_}"
echo "start ${NETNS} ${BRIDGE}"
exec ip netns exec "$NETNS" \
dnsmasq \
--no-daemon \
--interface="$BRIDGE" \
--bind-interfaces \
--pid-file="/run/dnsmasq-$arg.pid" \
--conf-file="/etc/dnsmasq.d/$arg.conf" \
--no-hosts \
--no-resolv \
--log-facility="/var/log/dnsmasq-$arg.log" \
--no-daemon -p0