-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue-blogfront-remove.sh
40 lines (28 loc) · 1 KB
/
vue-blogfront-remove.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
#!/bin/bash
#Colors!
RED='\033[0;31m'
GREEN='\033[0;32m'
LIGHTBLUE='\033[1;34m'
PURPLE='\033[1;35m'
NC='\033[0m'
NUMBER=$RANDOM
echo -e "By removing $1, all information will be deleted and no longer able to be recovered."
echo -e "This includes all posts, users and other content from the blog."
echo -e "\n${RED}Remove $1 only at YOUR OWN RISK!${NC}\n"
echo -e "To confirm that you have read and fully understand and agree to the above statements, please type the following numbers: ${NUMBER}.\n"
read -p "Confirmation: " UserInput
if [[ ! $UserInput = $NUMBER ]]; then
echo -e "\n${RED}Your input is incorrect. Please fully read the above statements and try again${NC}"
exit
fi
if [ -d /opt/ambrest/blogs/$1/ ]; then
cd /opt/ambrest/blogs/$1
docker-compose down
cd ..
rm -rf /opt/ambrest/blogs/$1
rm -rf /etc/nginx/conf.d/$1.conf
systemctl restart nginx
echo -e "\n\n${GREEN}$1 was successfully uninstalled!${NC}"
else
echo -e "\n${RED}Could not find the domain: $1${NC}"
fi