#!/bin/sh

. /lib/functions.sh

cfg=mapcontroller

# singleton sections
sections="channel_plan sta_steering"

for sec in $sections; do
    # find unnamed section of given type, only index 0
    s=$(uci show $cfg | grep -oE "@${sec}\[0\]" | sort -u)
    [ "$s" = "" ] && continue

    uci rename $cfg.$s=$sec
done
