tfc-mirror/uninstall.sh

70 lines
2.1 KiB
Bash
Raw Permalink Normal View History

2019-03-03 10:26:31 +01:00
#!/usr/bin/env bash
# TFC - Onion-routed, endpoint secure messaging system
2020-02-02 02:25:32 +01:00
# Copyright (C) 2013-2020 Markus Ottela
2019-03-03 10:26:31 +01:00
#
# This file is part of TFC.
#
# TFC is free software: you can redistribute it and/or modify it under the terms
# of the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# TFC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with TFC. If not, see <https://www.gnu.org/licenses/>.
2019-08-23 00:30:57 +02:00
function yn_prompt {
2019-03-03 10:26:31 +01:00
echo "${1} (Y/N): "
read -s -n 1 REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
2019-12-03 02:30:38 +01:00
eval "${2}"
2019-03-03 10:26:31 +01:00
fi
}
2019-08-23 00:30:57 +02:00
function remove_prompt {
2019-03-03 10:26:31 +01:00
echo ''
if [[ $(dpkg-query -W -f='${Status}' '$1' 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
2019-08-23 00:30:57 +02:00
yn_prompt "Remove ${1} ?" "sudo apt remove ${1} -y"
2019-03-03 10:26:31 +01:00
fi
}
sudo rm -f /usr/share/pixmaps/tfc.png
sudo rm -f /usr/share/applications/TFC-Dev.desktop
sudo rm -f /usr/share/applications/TFC-Local-test.desktop
sudo rm -f /usr/share/applications/TFC-RP.desktop
2020-03-06 10:21:13 +01:00
sudo rm -f /usr/share/applications/TFC-RP-Qubes.desktop
2019-03-03 10:26:31 +01:00
sudo rm -f /usr/share/applications/TFC-RP-Tails.desktop
2020-03-06 10:21:13 +01:00
sudo rm -f /usr/share/applications/TFC-RxP-Qubes.desktop
2019-03-03 10:26:31 +01:00
sudo rm -f /usr/share/applications/TFC-TxP.desktop
2020-03-06 10:21:13 +01:00
sudo rm -f /usr/share/applications/TFC-TxP-Qubes.desktop
sudo rm -f /usr/bin/tfc-transmitter
sudo rm -f /usr/bin/tfc-receiver
sudo rm -f /usr/bin/tfc-relay
2019-03-03 10:26:31 +01:00
sudo rm -rf /opt/tfc/
yn_prompt "Remove user data?" "rm -rf $HOME/tfc/"
clear
echo "The uninstaller will next prompt you to select APT dependencies to uninstall."
2019-08-23 00:30:57 +02:00
echo "If you're unsure about whether you need it, select No."
2019-03-03 10:26:31 +01:00
echo ''
remove_prompt "git"
remove_prompt "libssl-dev"
remove_prompt "net-tools"
remove_prompt "python3-pip"
remove_prompt "python3-tk"
remove_prompt "terminator"
remove_prompt "tor"
echo ''
echo "TFC has been uninstalled."