#!/bin/sh

. /lib/functions.sh

rename_section() {
	local enable inst

	config_get interface "${1}" interface ""
	if [ -z "${interface}" ]; then
		return 0
	fi

	inst="$(echo "${1}"|cut -d '_' -f 2)"
	uci_rename twamp "${1}" "${interface}_${inst}"
}

config_load twamp
config_foreach rename_section twamp_reflector

exit 0

