-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuninstall-hashfile.sh
More file actions
74 lines (62 loc) · 2.88 KB
/
uninstall-hashfile.sh
File metadata and controls
74 lines (62 loc) · 2.88 KB
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
#!/bin/bash
# Uninstall Script for hashfile
#----------------------------------------------------------------------
# Clear Screen
clear_screen="\033[H\033[2J";
# American National Standards Institute (ANSI) reset colour code
reset_colour="\033[0m";
# American National Standards Institute (ANSI) text colour code
text_bold_black="\033[1;30m";
text_bold_white="\033[1;37m";
# American National Standards Institute (ANSI) background colour codes
bg_green="\033[42m";
bg_yellow="\033[43m";
bg_purple="\033[45m";
#----------------------------------------------------------------------
# Check user is root otherwise exit script
if [ "$EUID" -ne 0 ]
then
printf $clear_screen;
printf $bg_yellow;
printf $text_bold_white;
printf " ╔════════════════════╗ \n";
printf " ║ Please run as root ║ \n";
printf " ╚════════════════════╝ \n";
printf $reset_colour;
exit;
fi;
#----------------------------------------------------------------------
# Remove the hashfile binary
printf $clear_screen;
printf $bg_purple;
printf $text_bold_white;
printf " ╔═══════════════════════════════════════════╗ \n";
printf " ║ Remove the hashfile binary from /usr/bin? ║ \n";
printf " ╚═══════════════════════════════════════════╝ \n";
printf $reset_colour;
printf "\n";
printf $text_bold_black;
read -p " Would you like to continue? [Yes/No]: " response;
if [ $response == "Yes" ] || [ $response == "yes" ] || [ $response == "YES" ] || [ $response == "Y" ] || [ $response == "y" ]
then
printf $reset_colour;
rm /usr/bin/hashfile;
printf $clear_screen;
printf $bg_green;
printf $text_bold_white;
printf " ╔════════════════════════════════════════════════════╗ \n";
printf " ║ The hashfile binary has been removed from /usr/bin ║ \n";
printf " ╚════════════════════════════════════════════════════╝ \n";
printf $reset_colour;
exit;
else
printf $reset_colour;
printf $clear_screen;
printf $bg_green;
printf $text_bold_white;
printf " ╔════════════════════════════════════════════════════════╗ \n";
printf " ║ Uninstall script exited, hashfile has not been removed ║ \n";
printf " ╚════════════════════════════════════════════════════════╝ \n";
printf $reset_colour;
exit;
fi;