#!/bin/sh

uci -q batch <<-EOF >/dev/null
	delete ucitrack.@shadowsocksr[-1]
	add ucitrack shadowsocksr
	set ucitrack.@shadowsocksr[-1].init=shadowsocksr
	commit ucitrack
	delete firewall.shadowsocksr
	set firewall.shadowsocksr=include
	set firewall.shadowsocksr.type=script
	set firewall.shadowsocksr.path=/var/etc/shadowsocksr.include
	set firewall.shadowsocksr.reload=1
	commit firewall
EOF

/usr/share/shadowsocksr/gfw2ipset.sh
rm -f /tmp/luci-indexcache
exit 0
