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

START=80

USE_PROCD=1
PROG=/usr/sbin/dynamic-vlan

start_service() {
	wan=$(cat /etc/board.json | jsonfilter -e '@.network.wan.device')
	[ -z "$wan" ] && eval $(jsonfilter -i /etc/board.json -e 'wan=@.network.wan.ports.*')
	procd_open_instance
	procd_set_param command "$PROG"
	for w in $wan; do
		procd_append_param command $w
	done
	procd_set_param respawn
	procd_close_instance
}
