diff --git a/auto_install/install.sh b/auto_install/install.sh index 0bd80ba..f92e6a6 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -9,11 +9,11 @@ # # curl -L https://install.pivpn.io | bash # Make sure you have `curl` installed -# timestamp 2020/5/11 16:48BST +# timestamp 2020/5/13 00:51BST ######## VARIABLES ######### #pivpnGitUrl="https://github.com/pivpn/pivpn.git" -pivpnGitUrl="/home/ubuntu/repos/pivpn" +pivpnGitUrl="/home/pi/repos/pivpn" setupVarsFile="setupVars.conf" setupConfigDir="/etc/pivpn" tempsetupVarsFile="/tmp/setupVars.conf" diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 8d04cea..ccdcb56 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -108,12 +108,12 @@ removeAll(){ vpnStillExists='no' if [ -r "${setupConfigDir}/${othervpn}/${setupVarsFile}" ]; then - vpnStillExists='yes' - $SUDO rm -f /usr/local/bin/pivpn - $SUDO ln -s -T /opt/pivpn/${othervpn}/pivpn.sh /usr/local/bin/pivpn - echo ":::" - echo "::: Two VPN protocols exist, you should remove the other one too" - echo ":::" + vpnStillExists='yes' + $SUDO rm -f /usr/local/bin/pivpn + $SUDO ln -s -T /opt/pivpn/${othervpn}/pivpn.sh /usr/local/bin/pivpn + echo ":::" + echo "::: Two VPN protocols exist, you should remove ${othervpn} too" + echo ":::" else rm -f /etc/bash_completion.d/pivpn @@ -179,24 +179,12 @@ removeAll(){ printf "::: Auto cleaning remaining dependencies..." $PKG_MANAGER -y autoclean &> /dev/null & spinner $!; printf "done!\\n"; - echo ":::" - # Removing pivpn files - echo "::: Removing pivpn system files..." if [ -f "$dnsmasqConfig" ]; then rm -f "$dnsmasqConfig" pihole restartdns fi - rm -rf /opt/pivpn/${VPN} - # if dual installation, other installation will cause next line to fail - rmdir /opt/pivpn - rm -rf /etc/.pivpn/${VPN} - rmdir /etc/.pivpn - rm -rf /etc/pivpn/${VPN} - rmdir /etc/pivpn - rm -f /var/log/*pivpn* - echo ":::" echo "::: Removing VPN configuration files..." @@ -215,6 +203,21 @@ removeAll(){ rm -rf "$install_home/ovpns" fi + if [ ${vpnStillExists} == 'no' ]; then + echo ":::" + echo "::: Removing pivpn system files..." + rm -rf /etc/.pivpn + rm -rf /etc/pivpn + rm -f /var/log/*pivpn* + rm -rf /opt/pivpn + rm -f /usr/local/bin/pivpn + else + echo ":::" + echo "::: Other protocol still present, so not" + echo "::: removing pivpn system files" + rm -f "${setupConfigDir}/${VPN}/${setupVarsFile}" + fi + echo ":::" printf "::: Finished removing PiVPN from your system.\\n" printf "::: Reinstall by simpling running\\n:::\\n:::\\tcurl -L https://install.pivpn.io | bash\\n:::\\n::: at any time!\\n:::\\n"