Adding an application, updating UCI

Hi,

I am developing a new application, a daemon for Openwrt. For addressing custom needs. I'd like to centralize its configuration file in UCI, and retrieve its configuration from UCI using the c library (libuci). Before that, I'm trying to amend the configuration to add its section. Let's say my application is called "foobar".

# uci add foobar connection
uci: Entry not found
# echo $?
3

Or if I type in:

# uci set foobar.connection.host=192.168.0.2
uci: Entry not found
# echo $?
1

What am I missing here? How can I do that? Is it even possible to amend the UCI system to add new application?

I don't think UCI creates new config files. Can you imagine that if you made a typo on any command and instead of rejecting it you ended up with another random file and no sense that something went wrong?

Just touch foobar first to create the file.

1 Like

Alternatively:

uci import foobar < /dev/null

(found here)

HTH.

1 Like