Update /etc/config/openvpn flat file

I am running a wrt1200ac running davidc502 caiman build for it. I have been trying to manually edit the above mentioned openvpn flat file. When I do and I go back into Luci, it shows a blank configuration. My guess is there is a cache or multiple files being used here, but not sure. I've searched and haven't really found an answer.

So I am at a state where I have an updated openvpn file, but Luci shows a blank configuration.

First, is there a way to update this file and not have the Luci configuration go blank? Second, being in a state with an updated openvpn file and a blank Luci configuration in services > openvpn, how do I restore it and get my updated configuration back?

Any help is appreciated. Thanks.

Check for the original under /rom/etc/config if needed.
When editing /etc/config/files manually be sure to get it right. Most LuCI frontends do not respond to mistakes kindly(little error checking), but check for errors.

1 Like

So if I rename mine, and copy the original from /rom/etc/config, then reboot, it should be back to stock?

Actually, I made a backup before I edited. When I rename that backup, reboot, the Luci configuration is still blank.

Maybe check log to see if an error is generated

logread | grep openvpn

bounce openvpn if needed

/etc/init.d/openvpn restart

You can view/edit ovpn-profiles from CLI.
luci-app-openvpn from OpenWrt 18.06 does not support ovpn-format view/edit.
Wait for next release, install snapshot or compile from sources if you need LuCI support.
And note that WebUI settings are ignored if you use ovpn-profile.

My understanding is that the OP has a blank openvpn LuCI support page on a snapshot image of unknown vintage.

1 Like

Yep, don't really want to use opvn files. Just prefer the flat file. Easier to make changes to.

Yes I know how to backup and restore. But since I did not have a working config, doing a restore would take me back to ground 0 and a couple hours of configuration lost.
There has to be a way to get Luci to recognize an OpenVPN flat file that was working previously....

You are correct. I edited the openvpn file and Luci came with a blank configuration. I then changed the name of the backup of the openvpn file back to openvpn, and rebooted. Luci still comes up with a blank configuration even though this file worked fine before I duplicated it to edit (so I'd have a backup). The snapshot is OpenWrt SNAPSHOT r9614-b61495409b / LuCI Master (git-19.069.61084-db98461). Thanks.

Alright. Deleted openvpn flat file. Went into Luci and added a new config item and rebooted. A new openvpn flat file was created. So now I'll gingerly edit it. Seems weird to me that it would not work with a file that worked previously. Must be a Boolean or such in there that makes it impossible to do that. I've come from dd-wrt because openWRT with OpenVPN blows the doors off dd-wrt with OpenVPN. But I must say, Luci certainly is not a very good front end. Maybe it's just my build.

Thanks for the help!

Not GUI orientated myself, but here is one possible method of handling things.