Question about upgrading LEDE remotely via OpenVPN [Solved]

Hello!

A few topics touched on this a little but not exactly what I was looking for. Basically, I want to perform a sysupgrade remotely. I am deployed and cannot do it locally. I have OpenVPN configured and can upgrade via ssh but my question is:

Do the OpenVPN configs get preserved and are they automatically reinstalled once the update is complete? I can reconfigure the rest of my settings and stuff as long as I can reconnect after the upgrade.

Thanks in advance!

Edit: Changed misleading title.

Configs, yes (unless you explicitly reject it, sysupgrade -n) - additionally installed packages, no (so if you need those to get online, you'll have a problem; e.g. openvpn).

Very personally I'd be wary to try an upgrade remotely via luci - and I'd be more confident in the current sysupgrade code (which was changed to be more self-contained/ atomic) than before (I think that's a post-17.01.x improvement) than the old for such a use case.

1 Like

Ah okay, so you are saying that my openvpn configs would be saved but not the actual openvpn package itself, correct?

Correct (unless you build a custom firmware image including openvpn in the squashfs part of the firmware, rather than the overlay).

1 Like

Well poop. Thank you so much! This could have really ruined my day!

In your current running router you should put something like this, also put the same in /files on your build image box to build newer images with this file embedded :

cat<<'EOF' >> /etc/sysupgrade.conf
/etc/config
/etc/profile
/etc/firewall.user
/root
/etc/crontabs/root
/etc/openvpn
EOF

Neither of those are necessary (all of those files are retained by default anyways!), nor will it help in the absence of the openvpn daemon (the binaries) - which you can't keep over an upgrade (without risking 'explosions' due to incompatible library ABIs).

2 Likes