-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsp-no-https.sh
More file actions
65 lines (50 loc) · 2.22 KB
/
Copy pathsp-no-https.sh
File metadata and controls
65 lines (50 loc) · 2.22 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
# HTTPS add into Serverpilot
RED='\033[0;31m'
NC='\033[0m' # No Color
GREEN='\033[0;32m'
#==
echo -e "${RED}"
echo -e ""
echo -e " ###############################################################"
echo -e " ## THIS WILL REMOVE THE CUSTOM VHOST FOR SERVERPILOT ##"
echo -e " ## ##"
echo -e " ## ${NC}** USE AT YOUR OWN RISK **${RED} ##"
echo -e " ## ##"
echo -e " ###############################################################"
echo -e "${NC}"
echo "Do you want to remove the custom conf file for HTTPS (y/n)?"
echo -e "${RED} ** this cannot be undone **${NC}"
read DFRUN
if [ $DFRUN == "y" ]; then
echo "What is your current app name?"
read MYAPP
# Check whether the app exists
#Parse Dir structure for APP
MYAPP_FILE='/etc/nginx-sp/vhosts.d/'$MYAPP'.custom.conf'
# Lets check if a custom conf exists
if [ ! -f ${MYAPP_FILE} ]; then echo -e "${RED}CUSTOM CONFIG NOT FOUND${NC} - Check your spelling and try again"; echo "you may have not setup a custom config yet"; exit; fi
# Remove the custom files
# START WITH NGINX-SP
cd /etc/nginx-sp/vhosts.d/
# We have to create/overwrite any custom files to ensure no errors popup
rm -f $MYAPP.custom.conf
# NOW LETS DO APACHE
cd /etc/apache-sp/vhosts.d/
rm -f $MYAPP.custom.conf
#ALL DONE, Lets restart both services
echo -e "Do you want to ${RED}RESTART${NC} nginx and apache services (y/n)?"
echo "needed to turn off SSL"
read DFRUNR
if [ $DFRUNR == "y" ]; then
sudo service nginx-sp restart
sudo service apache-sp restart
echo -e "${GREEN}All Done! SSL is now disabled${NC}"
exit;
else
echo "No services restarted, config files have been removed"
echo "both your nginx and apache service needs to be restarted in order for the changes to reflected"
fi
fi
else
echo -e "${GREEN}Keep SSL? Left the conf files alone${NC}"
fi