From ff77077d56ca572f270b702ae1fd95bbd70d382e Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 10 May 2020 21:46:54 +0000 Subject: [PATCH] more uninstall --- scripts/uninstall.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 12a2675..86df98d 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -105,8 +105,22 @@ removeAll(){ fi + vpnStillExists='no' + + if [ -r "${setupConfigDir}/${othervpn}/${setupVarsFile}" ]; then + vpnStillExists='yes' + $SUDO rm -f /usr/local/bin/pivpn + $SUDO ln -s -T ${pivpnScriptDir}/${othervpn}/pivpn.sh /usr/local/bin/pivpn + echo ":::" + echo "::: Two VPN protocols exist, you should remove the other one too" + echo ":::" + + else + rm -f /etc/bash_completion.d/pivpn + fi + # Disable IPv4 forwarding - if [ ${vpnStillExists} != 'yes' ]; then + if [ ${vpnStillExists} == 'no' ]; then sed -i '/net.ipv4.ip_forward=1/c\#net.ipv4.ip_forward=1' /etc/sysctl.conf sysctl -p fi @@ -183,20 +197,6 @@ removeAll(){ rmdir /etc/pivpn rm -f /var/log/*pivpn* - vpnStillExists='no' - - if [ -r "${setupConfigDir}/${othervpn}/${setupVarsFile}" ]; then - $SUDO rm -f /usr/local/bin/pivpn - $SUDO ln -s -T ${pivpnScriptDir}/${othervpn}/pivpn.sh /usr/local/bin/pivpn - vpnStillExists='yes' - echo ":::" - echo "::: Two VPN protocols exist, you should remove the other one too" - echo ":::" - - else - rm -f /etc/bash_completion.d/pivpn - fi - echo ":::" echo "::: Removing VPN configuration files..."