#!/bin/sh

uci -q batch <<-EOF >/dev/null
	delete firewall.ssr_mudb_server
	set firewall.ssr_mudb_server=include
	set firewall.ssr_mudb_server.type=script
	set firewall.ssr_mudb_server.path=/var/etc/ssr_mudb_server.include
	set firewall.ssr_mudb_server.reload=1
EOF

uci -q batch <<-EOF >/dev/null
	delete ucitrack.@ssr_mudb_server[-1]
	add ucitrack ssr_mudb_server
	set ucitrack.@ssr_mudb_server[-1].init=ssr_mudb_server
	commit ucitrack
EOF

chmod a+x /usr/share/ssr_mudb_server/* >/dev/null 2>&1
cp -rf /usr/bin/python3 /usr/bin/python
rm -rf /tmp/luci-*cache
exit 0
