-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb_vars_script.sh
More file actions
54 lines (46 loc) · 1.53 KB
/
web_vars_script.sh
File metadata and controls
54 lines (46 loc) · 1.53 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
#!/bin/bash
#Variables Declaration
PACKAGE="httpd wget unzip"
SVC="httpd"
URL="https://www.tooplate.com/zip-templates/2098_health.zip"
ARTIFACT_NAME="2098_health"
TEMPDIR="/tmp/webfiles"
NULL="/dev/null"
#Installing Dependencies
echo "#####################################################################"
echo "Installing packages"
echo "#####################################################################"
sudo yum install $PACKAGE -y > $NULL
echo
# Start & Enable Service
echo "#####################################################################"
echo "Start & Enable HTTPS Service"
echo "#####################################################################"
sudo systemctl start $SVC
sudo systemctl enable $SVC
echo
# Creating Temp directory
echo "#####################################################################"
echo "Starting Artifact Deployment"
echo "#####################################################################"
mkdir -p $TEMPDIR
cd $TEMPDIR
echo
wget $URL > $NULL
unzip $ARTIFACT_NAME.zip > $NULL
sudo cp -r $ARTIFACT_NAME/* /var/www/html
echo
# Bounce Service
echo "#####################################################################"
echo "Restarting HTTPD Service"
echo "#####################################################################"
systemctl restart $SVC
echo
# Clean up
echo "#####################################################################"
echo "Removing temp files"
echo "#####################################################################"
rm -rf $TEMPDIR
echo
sudo systemctl status $SVC
ls /var/www/html