-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathwebsetupmulti.sh
More file actions
87 lines (74 loc) · 2.17 KB
/
websetupmulti.sh
File metadata and controls
87 lines (74 loc) · 2.17 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
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
: ' This script will setup sloopa website on
CENTOS 7.5 HTTPD service.
'
source /tmp/vars.txt
# Redirecting all the output/Suppressing output of yum command.
yum --help > /dev/null 2> /dev/null
if [ $? -eq 0 ]
then
echo "################################################################"
echo "RedHat based system detected."
echo "################################################################"
SVC=httpd
PACKS='httpd wget unzip'
# Setup packages
echo
echo
echo "Installing Packages"
yum install $PACKS -y
echo "################################################################"
# Start & Enable Service
echo
echo
echo "Starting and Enabling Service"
systemctl start $SVC
systemctl enable $SVC
echo "################################################################"
# Copy website data to apache Doc Root Dir.
echo
echo
echo "Copying website data"
cd /tmp && wget -O website.zip $WEBURL
cd /tmp/ && unzip -o website.zip
cp -r /tmp/$DIRNAME/* /var/www/html/
echo
echo
echo "Restarting Service"
# Restart SERVICE
systemctl restart $SVC
echo "################################################################"
else
echo "################################################################"
echo "Debian based system detected."
echo "################################################################"
SVC=apache2
PACKS='apache2 wget unzip'
# Setup packages
echo
echo
echo "Installing Packages"
apt install $PACKS -y
echo "################################################################"
# Start & Enable Service
echo
echo
echo "Starting and Enabling Service"
systemctl start $SVC
systemctl enable $SVC
echo "################################################################"
# Copy website data to apache Doc Root Dir.
echo
echo
echo "Copying website data"
cd /tmp && wget -O website.zip $WEBURL
cd /tmp/ && unzip -o website.zip
cp -r /tmp/$DIRNAME/* /var/www/html/
echo "################################################################"
echo
echo
echo "Restarting Service"
# Restart SERVICE
systemctl restart $SVC
echo "################################################################"
fi