-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
uninstall.sh
executable file
·81 lines (70 loc) · 2.98 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
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
#//////////////////////////////////////////////////////////////
#// ____ //
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
#// |_| |_| //
#//////////////////////////////////////////////////////////////
#// //
#// Script, 2021 //
#// Created: 27, May, 2021 //
#// Modified: 24, July, 2021 //
#// file: - //
#// - //
#// Source: https://unix.stackexchange.com/a/39341/359833 //
#// https://stackoverflow.com/a/42876846/10152334 //
#// OS: ALL //
#// CPU: ALL //
#// //
#//////////////////////////////////////////////////////////////
if [ $# -eq 0 ]; then
read -r -p "Uninstall Software ? [Y/n]: " answ
if [ "$answ" == 'n' ]; then
exit 1
fi
fi
if [[ "$EUID" = 0 ]]; then
echo "(1) already root"
else
sudo -k # make sure to ask for password on next sudo
if sudo true; then
echo "(2) correct password"
else
echo "(3) wrong password"
exit 1
fi
fi
DIR="/usr/bin/ben_script/"
if [ ! -d "$DIR" ]; then
# Take action if $DIR exists. #
echo "${DIR} does not exist..."
exit 0
fi
echo "Removing Bash-Snippet..."
cd /usr/bin/ben_script/Bash-Snippet || { echo "Failure"; exit 1; }
sudo ./uninstall.sh all
echo "Removing Bash-Snippet done"
echo "Removing git-extras..."
cd /usr/bin/ben_script/git/git-extras || { echo "Failure"; exit 1; }
sudo make uninstall
echo "Removing git-extras done"
echo "Removing git-quick-stats..."
cd /usr/bin/ben_script/git/git-quick-stats || { echo "Failure"; exit 1; }
sudo make uninstall
echo "Removing git-quick-stats done"
echo "Removing fff..."
cd /usr/bin/ben_script/fff || { echo "Failure"; exit 1; }
sudo make uninstall
echo "Removing fff done"
echo "Removing ben's scripts, git-scripts, git-extra-commands, cryptr, bash-scripts, shell-scripts, docker-scripts, gpg-encrypt, spoofpoint, adb-sync..."
echo "Remove symlink..."
sudo find /usr/bin -lname '/usr/bin/ben_script/*' -delete
echo "Remove symlink done"
echo "Remove ben_script file from /usr/bin..."
sudo rm -fr /usr/bin/ben_script
echo "Remove ben_script done"
echo "Removing ben's scripts, git-scripts, git-extra-commands, cryptr done"
#sudo rm -fr /usr/bin/ben_script && sudo find /usr/bin/ -xtype l -delete
echo "Removing done"