forked from maqp/tfc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
69 lines (57 loc) · 2.08 KB
/
uninstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# TFC - Onion-routed, endpoint secure messaging system
# Copyright (C) 2013-2020 Markus Ottela
#
# 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/>.
function yn_prompt {
echo "${1} (Y/N): "
read -s -n 1 REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
eval "${2}"
fi
}
function remove_prompt {
echo ''
if [[ $(dpkg-query -W -f='${Status}' '$1' 2>/dev/null | grep -c "ok installed") -eq 0 ]]; then
yn_prompt "Remove ${1} ?" "sudo apt remove ${1} -y"
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
sudo rm -f /usr/share/applications/TFC-RP-Qubes.desktop
sudo rm -f /usr/share/applications/TFC-RP-Tails.desktop
sudo rm -f /usr/share/applications/TFC-RxP-Qubes.desktop
sudo rm -f /usr/share/applications/TFC-TxP.desktop
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
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."
echo "If you're unsure about whether you need it, select No."
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."