#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-taskplan.json" ] && {
    cat > /usr/share/ucitrack/luci-app-taskplan.json << EEOF
{
    "config": "taskplan",
    "init": "taskplan"
}
EEOF
}
chmod +x  /etc/init.d/taskplan /usr/bin/taskplanhandler /etc/init.d/taskplanrun
uci -q batch <<-EOF >/dev/null
	delete ucitrack.@taskplan[-1]
	add ucitrack taskplan 
	set ucitrack.@taskplan[-1].init="taskplan"
	commit ucitrack
EOF
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache*
exit 0