#!/bin/sh

. /lib/functions.sh

CFG="poe"

config_load "$CFG" || exit 0

uci -q show "$CFG" | while IFS='.= ' read -r _ sec rest; do
        case "$rest" in
        port[0-9]*) uci_add "$CFG" "port" "$sec" ;;
        chip[0-9]*) uci_add "$CFG" "chip" "$sec" ;;
    esac
done

uci_commit "$CFG"

exit 0
