Ipsec configuration using uci commands

Hi, I am trying to configure Ipsec in Cloudgate modem (that runs OpenWrt). The settings will be located in /etc/config/ipsec once set. I need to set the settings in a shell script. I assume that uci commands are good for this but I don't know how to do this when the file does not yet exists.
I know that the settings can be set like this (for device_name): uci set ipsec..device_name=theDeviceName. How to do this when the ipsec file does not exists? How to get this ID?

may be you need add this id? like
uci add <config> <section-type>

1 Like

There are 3 methods to use the UCI. Accessing the file is one of those methods. I'm not sure about your specific need to use a shell script, though.

I hope this thread helps you more: IPsec site-to-site tunnel