#!/bin/sh

. /lib/functions.sh

CONFIG="dropbear"
MAIN_SEC_NAME="main"

# If a named 'main' section already exists, nothing to do
if uci_show "$CONFIG" "$MAIN_SEC_NAME" > /dev/null; then
    exit 0
fi

uci_rename "$CONFIG" "@dropbear[0]" "$MAIN_SEC_NAME"
uci_commit "$CONFIG"

exit 0
