From c04f7f0bd8b22ea0b9662c4c71f74672003b0923 Mon Sep 17 00:00:00 2001 From: oblique Date: Thu, 28 Aug 2014 20:50:09 +0300 Subject: [PATCH] Redirect iptables output to /dev/null on cleanup --- create_ap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/create_ap b/create_ap index 9ceb582..8d9c062 100755 --- a/create_ap +++ b/create_ap @@ -259,9 +259,9 @@ cleanup() { if [[ "$SHARE_METHOD" != "none" ]]; then if [[ "$SHARE_METHOD" == "nat" ]]; then - iptables -t nat -D POSTROUTING -o ${INTERNET_IFACE} -j MASQUERADE - iptables -D FORWARD -i ${WIFI_IFACE} -s ${GATEWAY%.*}.0/24 -j ACCEPT - iptables -D FORWARD -i ${INTERNET_IFACE} -d ${GATEWAY%.*}.0/24 -j ACCEPT + iptables -t nat -D POSTROUTING -o ${INTERNET_IFACE} -j MASQUERADE > /dev/null 2>&1 + iptables -D FORWARD -i ${WIFI_IFACE} -s ${GATEWAY%.*}.0/24 -j ACCEPT > /dev/null 2>&1 + iptables -D FORWARD -i ${INTERNET_IFACE} -d ${GATEWAY%.*}.0/24 -j ACCEPT > /dev/null 2>&1 [[ -n $OLD_IP_FORWARD ]] && echo $OLD_IP_FORWARD > /proc/sys/net/ipv4/ip_forward elif [[ "$SHARE_METHOD" == "bridge" ]]; then ip link set down $BRIDGE_IFACE @@ -271,9 +271,9 @@ cleanup() { fi if [[ "$SHARE_METHOD" != "bridge" ]]; then - iptables -D INPUT -p tcp -m tcp --dport 53 -j ACCEPT - iptables -D INPUT -p udp -m udp --dport 53 -j ACCEPT - iptables -D INPUT -p udp -m udp --dport 67 -j ACCEPT + iptables -D INPUT -p tcp -m tcp --dport 53 -j ACCEPT > /dev/null 2>&1 + iptables -D INPUT -p udp -m udp --dport 53 -j ACCEPT > /dev/null 2>&1 + iptables -D INPUT -p udp -m udp --dport 67 -j ACCEPT > /dev/null 2>&1 fi if [[ $NO_VIRT -eq 0 ]]; then