From 70ccbf30f34e47563dae9487a339e50f7ceaccf9 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 24 May 2023 10:02:00 +0000 Subject: [PATCH] Revert "update.sh: Adds code to update an existing ovpnconfig with pass or no-pass" This reverts commit 9cac1034bcfe423c4a5e0f547664fbabcf9050e6. https://lists.ipfire.org/pipermail/development/2023-May/015952.html Signed-off-by: Michael Tremer --- config/rootfiles/core/175/update.sh | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/config/rootfiles/core/175/update.sh b/config/rootfiles/core/175/update.sh index 83303a1c3d..5e45c819f8 100644 --- a/config/rootfiles/core/175/update.sh +++ b/config/rootfiles/core/175/update.sh @@ -177,30 +177,6 @@ if [ -e /boot/pakfire-kernel-update ]; then /boot/pakfire-kernel-update ${KVER} fi -## Modify ovpnconfig according to bug 11048 for pass, no-pass modification in ovpnconfig index -# Check if ovpnconfig exists and is not empty -if [ -s /var/ipfire/ovpn/ovpnconfig ]; then - # Make all N2N connections 'no-pass' since they do not use encryption - awk '{FS=OFS=","} {if($5=="net") {$43="no-pass"; print $0}}' /var/ipfire/ovpn/ovpnconfig >> /var/ipfire/ovpn/ovpnconfig.new - - # Evaluate roadwarrior connection names for *.p12 files - for y in $(awk -F',' '/host/ { print $3 }' /var/ipfire/ovpn/ovpnconfig); do - # Sort all unencrypted roadwarriors out and set 'no-pass' in [43] index - if [[ -n $(openssl pkcs12 -info -in /var/ipfire/ovpn/certs/${y}.p12 -noout -password pass:'' 2>&1 | grep 'Encrypted') ]]; then - awk -v var="$y" '{FS=OFS=","} {if($3==var) {$43="no-pass"; print $0}}' /var/ipfire/ovpn/ovpnconfig >> /var/ipfire/ovpn/ovpnconfig.new - fi - # Sort all encrypted roadwarriors out and set 'pass' in [43] index - if [[ -n $(openssl pkcs12 -info -in /var/ipfire/ovpn/certs/${y}.p12 -noout -password pass:'' 2>&1 | grep 'error') ]]; then - awk -v var="$y" '{FS=OFS=","} {if($3==var) {$43="pass"; print $0}}' /var/ipfire/ovpn/ovpnconfig >> /var/ipfire/ovpn/ovpnconfig.new - fi - done -fi - -# Replace existing ovpnconfig with updated index -mv /var/ipfire/ovpn/ovpnconfig.new /var/ipfire/ovpn/ovpnconfig -# Set correct ownership -chown nobody:nobody /var/ipfire/ovpn/ovpnconfig - # This update needs a reboot... touch /var/run/need_reboot -- 2.39.5