This repository has been archived by the owner on Jun 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuninstall.sh
executable file
·77 lines (73 loc) · 2.01 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
#!/bin/bash
puts() {
# Num Colour #define R G B
# 0 black COLOR_BLACK 0,0,0
# 1 red COLOR_RED 1,0,0
# 2 green COLOR_GREEN 0,1,0
# 3 yellow COLOR_YELLOW 1,1,0
# 4 blue COLOR_BLUE 0,0,1
# 5 magenta COLOR_MAGENTA 1,0,1
# 6 cyan COLOR_CYAN 0,1,1
# 7 white COLOR_WHITE 1,1,1
text=$1
case $2 in
"black"|"BLACK")
output_color=0
;;
"red"|"RED")
output_color=1
;;
"green"|"GREEN")
output_color=2
;;
"yellow"|"YELLOW")
output_color=3
;;
"blue"|"BLUE")
output_color=4
;;
"magenta"|"MAGENTA")
output_color=5
;;
"cyan"|"CYAN")
output_color=6
;;
"white"|"WHITE")
output_color=7
;;
esac
if [ -z "$output_color" ]; then
echo "$text"
else
echo "$(tput setaf $output_color)$text $(tput sgr 0)"
fi
unset output_color
}
# Remove jefe_nginx_proxy container
if [ "$(docker ps | grep jefe_nginx_proxy)" ]; then # If jefe_nginx_proxy containr is running then stop
puts "Stoping jefe_nginx_proxy container..." BLUE
docker stop jefe_nginx_proxy
puts "Done." GREEN
fi
puts "Removing jefe_nginx_proxy container..." BLUE
docker rm jefe_nginx_proxy
puts "Done." GREEN
# Remove jefe alias from .zshrc file
if [ -f ~/.zshrc ]
then
puts " Removing jefe alias from .zshrc file..."
sed -i "/# ----- Begin jefe-cli -----/,/# ----- End jefe-cli -----/ d" ~/.zshrc
puts "Done." GREEN
fi
# Remove jefe alias from .zshrc file
if [ -f ~/.bashrc ]
then
puts "Removing jefe alias from .zshrc file"
sed -i "/# ----- Begin jefe-cli -----/,/# ----- End jefe-cli -----/ d" ~/.bashrc
puts "Done." GREEN
fi
# Delete instalation of jefe-cli
puts "Deleting instalation of jefe-cli..."
rm -rf ~/.jefe-cli/
puts "Done." GREEN
puts "Uninstalled successfully!" GREEN