#!/bin/sh /etc/rc.common

START=97

start_handle(){
	config_get enabled $1 enabled
	config_get ip $1 ip
	if [  "$enabled" != "1" ] ;then
			iptables -I gamehunter_forward -m string --string "$ip" --algo kmp -j DROP
	fi
}

stop() {
	iptables -D FORWARD -j gamehunter_forward 2>/dev/null 
	iptables -F gamehunter_forward 2>/dev/null
	iptables -X gamehunter_forward 2>/dev/null
	return 0
}

start() {
	stop
	config_load gamehunter
	config_get enabled main enabled
	if [ "1" != "$enabled" ]; then 
		return 0
	fi
	
	iptables -N gamehunter_forward
	iptables -I FORWARD -j gamehunter_forward
	config_foreach start_handle rule
}
