|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
# iptables -A INPUT -i eth0 -p tcp --dport 139 -j ACCEPT
|
|
|
|
|
#
|
|
|
|
|
# called by:
|
|
|
|
|
# - cron (/etc/cron.d/cryptobox
|
|
|
|
|
# - cron (/etc/cron.d/cryptobox)
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
@ -29,7 +29,7 @@ set -eu
|
|
|
|
|
filter_ipt_rules()
|
|
|
|
|
# get the input rules for smb datagram traffic
|
|
|
|
|
{
|
|
|
|
|
iptables -L INPUT -vnx | grep -E "udp dpt:138|tcp dpt:139"
|
|
|
|
|
"$IPTABLES" -L INPUT -vnx | grep -E "udp dpt:138|tcp dpt:139"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -41,7 +41,7 @@ function check_for_traffic()
|
|
|
|
|
filter_ipt_rules | sed 's/ */ /g' | cut -d " " -f 3 | while read a
|
|
|
|
|
do [ "$a" -gt 0 ] && echo "$a"
|
|
|
|
|
done | grep -q "" && traffic_yes=1
|
|
|
|
|
iptables -Z INPUT
|
|
|
|
|
"$IPTABLES" -Z INPUT
|
|
|
|
|
[ "$traffic_yes" = "1" ]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -56,7 +56,7 @@ MAX_IDLE_COUNTER=$("$CB_SCRIPT" get_config timeout)
|
|
|
|
|
[ "$MAX_IDLE_COUNTER" -eq 0 ] && exit 0
|
|
|
|
|
|
|
|
|
|
# config test
|
|
|
|
|
[ -z "`filter_ipt_rules`" ] && echo "[`basename $0`]: Could not find a matching iptables rule!" >>"$LOG_FILE" && exit 1
|
|
|
|
|
[ -z "$(filter_ipt_rules)" ] && echo "[`basename $0`]: Could not find a matching iptables rule!" >>"$LOG_FILE" && exit 1
|
|
|
|
|
|
|
|
|
|
# read current idle counter
|
|
|
|
|
if [ -e "$IDLE_COUNTER_FILE" ]
|
|
|
|
|