From 2c9c0ed0c31734110ba4a9c2fe7cb75db31298c3 Mon Sep 17 00:00:00 2001 From: randomshell <43271778+randomshell@users.noreply.github.com> Date: Fri, 10 Apr 2020 09:42:57 +0000 Subject: [PATCH] Improve sed line deletion (#608) --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 2a36390..e0bdb13 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -1120,7 +1120,7 @@ function revokeClient () { chmod 644 /etc/openvpn/crl.pem find /home/ -maxdepth 2 -name "$CLIENT.ovpn" -delete rm -f "/root/$CLIENT.ovpn" - sed -i "s|^$CLIENT,.*||" /etc/openvpn/ipp.txt + sed -i "/^$CLIENT,.*/d" /etc/openvpn/ipp.txt echo "" echo "Certificate for client $CLIENT revoked." @@ -1128,7 +1128,7 @@ function revokeClient () { function removeUnbound () { # Remove OpenVPN-related config - sed -i 's|include: \/etc\/unbound\/openvpn.conf||' /etc/unbound/unbound.conf + sed -i '/include: \/etc\/unbound\/openvpn.conf/d' /etc/unbound/unbound.conf rm /etc/unbound/openvpn.conf until [[ $REMOVE_UNBOUND =~ (y|n) ]]; do