From 3e349e96d9dcde36c13f59b60e7d67a62bf41cfc Mon Sep 17 00:00:00 2001 From: cezar97 Date: Wed, 4 Jul 2018 02:24:41 +0300 Subject: [PATCH] Uninstalling OpenVPN remove ovpns --- openvpn-install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openvpn-install.sh b/openvpn-install.sh index 7a73a14..1b37e46 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -155,6 +155,12 @@ if [[ -e /etc/openvpn/server.conf ]]; then else yum remove openvpn -y fi + OVPNS=$(ls /etc/openvpn/easy-rsa/pki/issued | awk -F "." {'print $1'}) + for i in $OVPNS + do + rm $(find /home -maxdepth 2 | grep $i.ovpn) 2>/dev/null + rm /root/$i.ovpn 2>/dev/null + done rm -rf /etc/openvpn rm -f /etc/sysctl.d/30-openvpn-forward.conf echo