from Zorp.Zorp import quit, message
from Zorp.IPChains import IPChains
from Zorp.Domain import InetDomain
from traceback import print_exc
import time

def init(name):
	try:
		pf = IPChains()
		sdom = InetDomain('192.168.131.0/24')
		ddom = InetDomain('0.0.0.0/0')
		r = pf.addREDIRECT('zorp', sdom, (1000, 2000), ddom, (0, 65535), 80, proto=6)
		time.sleep(10)
		pf.delRule(r)
	except:
		print_exc()
		quit(1)
		return
	quit(0)
