From 90dc5fdd8d7df6292924e2533f46a236ad16e6a6 Mon Sep 17 00:00:00 2001 From: garywill <32130780+garywill@users.noreply.github.com> Date: Fri, 31 Aug 2018 18:41:06 +0800 Subject: [PATCH] fix _cleanup() didn't judge NO_DNSMASQ --- create_ap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/create_ap b/create_ap index 7404190..b02cc67 100755 --- a/create_ap +++ b/create_ap @@ -688,7 +688,10 @@ _cleanup() { iptables -w -t nat -D PREROUTING -s ${GATEWAY%.*}.0/24 -d ${GATEWAY} \ -p udp -m udp --dport 53 -j REDIRECT --to-ports $DNS_PORT fi - iptables -w -D INPUT -i ${SUBNET_IFACE} -p udp -m udp --dport 67 -j ACCEPT + + if [[ $NO_DNSMASQ -eq 0 ]]; then + iptables -w -D INPUT -i ${SUBNET_IFACE} -p udp -m udp --dport 67 -j ACCEPT + fi ip link set down dev ${AP_IFACE} ip addr flush ${AP_IFACE}