]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
update.sh: Fixes Bug#13137 - Existing n2n client connection created with openssl...
authorAdolf Belka <adolf.belka@ipfire.org>
Sun, 4 Jun 2023 18:57:09 +0000 (20:57 +0200)
committerPeter Müller <peter.mueller@ipfire.org>
Mon, 5 Jun 2023 14:49:51 +0000 (14:49 +0000)
- This modification will check if ovpnconfig exists and is not empty. If so then it will
   check for all n2n connections and if they are Client configs will check if
   "providers legacy default" is not already present and if so will add it.

Fixes: Bug#13137
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/core/175/update.sh

index 5e45c819f865de10c53d6bbc91d1c006b334f82a..82676bc72304667c44e7c41e13852c49ab6d4fb3 100644 (file)
@@ -177,6 +177,20 @@ if [ -e /boot/pakfire-kernel-update ]; then
     /boot/pakfire-kernel-update ${KVER}
 fi
 
+## Add providers legacy default line to n2n client config files
+# Check if ovpnconfig exists and is not empty
+if [ -s /var/ipfire/ovpn/ovpnconfig ]; then
+       # Identify all n2n connections
+       for y in $(awk -F',' '/net/ { print $3 }' /var/ipfire/ovpn/ovpnconfig); do
+           # Add the legacy option to all N2N client conf files
+               if [ $(grep -c "Open VPN Client Config" /var/ipfire/ovpn/n2nconf/${y}/${y}.conf) -eq 1 ] ; then
+                       if [ $(grep -c "providers legacy default" /var/ipfire/ovpn/n2nconf/${y}/${y}.conf) -eq 0 ] ; then
+                               echo "providers legacy default" >> /var/ipfire/ovpn/n2nconf/${y}/${y}.conf
+                       fi
+               fi
+       done
+fi
+
 # This update needs a reboot...
 touch /var/run/need_reboot