-
Notifications
You must be signed in to change notification settings - Fork 25
/
uninstall.sh
69 lines (56 loc) · 1.62 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
#!/bin/bash
# This script is created by Waseem Akram ( github.com/evildevill )
# This script is an uninstallation script for entropy
# It removes the program's files and installation directories
# It is meant to be run as root
printf '\033]2;uninstall.sh\a'
G="\033[1;34m[*] \033[0m"
S="\033[1;32m[+] \033[0m"
E="\033[1;31m[-] \033[0m"
if [[ $(id -u) != 0 ]]
then
echo -e ""$E"Permission denied!"
exit 1
fi
# Define the program name and installation directories
program_name="entropy"
install_directories=("/bin/entropy" "/usr/local/bin/entropy" "/data/data/com.termux/files/usr/bin/entropy" "$HOME/entropy")
# Prompt user to confirm before proceeding with the uninstallation
echo -e ""$G"This script will remove the $program_name program and its installation directories."
read -p "Are you sure you want to continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
# Remove the program's files and installation directories
for dir in "${install_directories}"
do
if [[ -d $dir ]]
then
echo -e ""$S"Removing $dir"
if ! rm -rf $dir; then
echo -e ""$E"Error: Unable to remove $dir"
exit 1
fi
else
echo -e ""$E"Error: $dir not found"
fi
done
echo -e ""$S"Uninstallation of $program_name complete!"
# #!/bin/bash
# printf '\033]2;uninstall.sh\a'
# G="\033[1;34m[*] \033[0m"
# S="\033[1;32m[+] \033[0m"
# E="\033[1;31m[-] \033[0m"
# if [[ $(id -u) != 0 ]]
# then
# echo -e ""$E"Permission denied!"
# exit
# fi
# {
# rm -rf ~/entropy
# rm /bin/entropy
# rm /usr/local/bin/entropy
# rm /data/data/com.termux/files/usr/bin/entropy
# } &> /dev/null