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

START=71
USE_PROCD=1

. /lib/functions.sh

start_service() {
	local enable=0
	local filter=0

	config_load catv
	config_get_bool enable catv enable 0
	config_get filter catv filter
	if [ $enable -eq 0 ]; then
		ubus call catv set-enable "{\"enable\":\"off\"}"
	else
		ubus call catv set-enable "{\"enable\":\"on\"}"
	fi
	ubus call catv set-filter "{\"filter\":\"$filter\"}"

}

service_triggers() {
        procd_add_reload_trigger catv
}

