then
$IPTABLES -t mangle -A "${SHAPE_CHAIN}" "$@" -j MARK --set-mark ${prio}
fi
+ if ! $IP6TABLES -t mangle -C "${SHAPE_CHAIN}" "$@" -j MARK --set-mark ${prio} >/dev/null 2>&1
+ then
+ $IP6TABLES -t mangle -A "${SHAPE_CHAIN}" "$@" -j MARK --set-mark ${prio}
+ fi
}
shape_if "${EXT_IF}" "${UPLINK}" "${BURST}"
if ! $IPTABLES -t mangle -L "${SHAPE_CHAIN}" >/dev/null 2>&1
then
- echo "initializing chain '${SHAPE_CHAIN}'"
+ echo "initializing ipv4 chain '${SHAPE_CHAIN}'"
$IPTABLES -t mangle -N "${SHAPE_CHAIN}"
fi
+if ! $IP6TABLES -t mangle -L "${SHAPE_CHAIN}" >/dev/null 2>&1
+then
+ echo "initializing ipv6 chain '${SHAPE_CHAIN}'"
+ $iP6TABLES -t mangle -N "${SHAPE_CHAIN}"
+fi
# prioritize small and responsive things
shape 1 -p icmp
$IPTABLES -t mangle -I POSTROUTING -o "${EXT_IF}" -j "${SHAPE_CHAIN}"
fi
+if ! $IP6TABLES -t mangle -C POSTROUTING -o "${EXT_IF}" -j "${SHAPE_CHAIN}" >/dev/null 2>&1
+then
+ $IP6TABLES -t mangle -I POSTROUTING -o "${EXT_IF}" -j "${SHAPE_CHAIN}"
+fi
+
+if [[ ! -e /etc/local.d/shaper.start ]]
+then
+ echo "add shaper to local rc start!"
+fi