#!/bin/sh

. /lib/functions.sh

config_load ieee1905

ifname_to_list() {
	local section=$1

	config_get ifname $section ifname	# get list or option as space separated values
	ifname=${ifname//,/\ }			# convert csv with space separation
	uci del ieee1905.${section}.ifname	# delete entry
	for i in ${ifname}; do
		uci add_list ieee1905.${section}.ifname="$i"	# writeback entry as list
	done
}

config_foreach ifname_to_list al-iface
