mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-19 03:10:16 +00:00
better uninstall.sh
This commit is contained in:
parent
be3ee13586
commit
4e3a57b9aa
2 changed files with 23 additions and 20 deletions
|
@ -9,11 +9,11 @@
|
||||||
#
|
#
|
||||||
# curl -L https://install.pivpn.io | bash
|
# curl -L https://install.pivpn.io | bash
|
||||||
# Make sure you have `curl` installed
|
# Make sure you have `curl` installed
|
||||||
# timestamp 2020/5/11 16:48BST
|
# timestamp 2020/5/13 00:51BST
|
||||||
|
|
||||||
######## VARIABLES #########
|
######## VARIABLES #########
|
||||||
#pivpnGitUrl="https://github.com/pivpn/pivpn.git"
|
#pivpnGitUrl="https://github.com/pivpn/pivpn.git"
|
||||||
pivpnGitUrl="/home/ubuntu/repos/pivpn"
|
pivpnGitUrl="/home/pi/repos/pivpn"
|
||||||
setupVarsFile="setupVars.conf"
|
setupVarsFile="setupVars.conf"
|
||||||
setupConfigDir="/etc/pivpn"
|
setupConfigDir="/etc/pivpn"
|
||||||
tempsetupVarsFile="/tmp/setupVars.conf"
|
tempsetupVarsFile="/tmp/setupVars.conf"
|
||||||
|
|
|
@ -108,12 +108,12 @@ removeAll(){
|
||||||
vpnStillExists='no'
|
vpnStillExists='no'
|
||||||
|
|
||||||
if [ -r "${setupConfigDir}/${othervpn}/${setupVarsFile}" ]; then
|
if [ -r "${setupConfigDir}/${othervpn}/${setupVarsFile}" ]; then
|
||||||
vpnStillExists='yes'
|
vpnStillExists='yes'
|
||||||
$SUDO rm -f /usr/local/bin/pivpn
|
$SUDO rm -f /usr/local/bin/pivpn
|
||||||
$SUDO ln -s -T /opt/pivpn/${othervpn}/pivpn.sh /usr/local/bin/pivpn
|
$SUDO ln -s -T /opt/pivpn/${othervpn}/pivpn.sh /usr/local/bin/pivpn
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Two VPN protocols exist, you should remove the other one too"
|
echo "::: Two VPN protocols exist, you should remove ${othervpn} too"
|
||||||
echo ":::"
|
echo ":::"
|
||||||
|
|
||||||
else
|
else
|
||||||
rm -f /etc/bash_completion.d/pivpn
|
rm -f /etc/bash_completion.d/pivpn
|
||||||
|
@ -179,24 +179,12 @@ removeAll(){
|
||||||
printf "::: Auto cleaning remaining dependencies..."
|
printf "::: Auto cleaning remaining dependencies..."
|
||||||
$PKG_MANAGER -y autoclean &> /dev/null & spinner $!; printf "done!\\n";
|
$PKG_MANAGER -y autoclean &> /dev/null & spinner $!; printf "done!\\n";
|
||||||
|
|
||||||
echo ":::"
|
|
||||||
# Removing pivpn files
|
|
||||||
echo "::: Removing pivpn system files..."
|
|
||||||
|
|
||||||
if [ -f "$dnsmasqConfig" ]; then
|
if [ -f "$dnsmasqConfig" ]; then
|
||||||
rm -f "$dnsmasqConfig"
|
rm -f "$dnsmasqConfig"
|
||||||
pihole restartdns
|
pihole restartdns
|
||||||
fi
|
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 ":::"
|
||||||
echo "::: Removing VPN configuration files..."
|
echo "::: Removing VPN configuration files..."
|
||||||
|
|
||||||
|
@ -215,6 +203,21 @@ removeAll(){
|
||||||
rm -rf "$install_home/ovpns"
|
rm -rf "$install_home/ovpns"
|
||||||
fi
|
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 ":::"
|
echo ":::"
|
||||||
printf "::: Finished removing PiVPN from your system.\\n"
|
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"
|
printf "::: Reinstall by simpling running\\n:::\\n:::\\tcurl -L https://install.pivpn.io | bash\\n:::\\n::: at any time!\\n:::\\n"
|
||||||
|
|
Loading…
Reference in a new issue