forked from gangireddydanam/automation1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapache_deploy
More file actions
40 lines (29 loc) · 903 Bytes
/
apache_deploy
File metadata and controls
40 lines (29 loc) · 903 Bytes
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/sh
SERVICE='httpd'
if ps -ef | grep -v grep | grep $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
rm -rf /var/www/html/*
echo "Deleted the content"
echo "Downloading the webstie cotent"
cd /opt/
sudo wget https://github.com/gangireddydanam/s3-to-ec2/archive/master.zip
sudo unzip master.zip
cd s3-to-ec2-master
sudo cp -r * /var/www/html/
else
echo "$SERVICE is not running"
sudo systemctl start httpd
if ps -ef | grep -v grep | grep $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
sudo rm -rf /var/www/html/*
echo "Deleted the content"
echo "Downloading the webstie cotent"
cd /opt/
sudo wget https://github.com/gangireddydanam/s3-to-ec2/archive/master.zip
sudo unzip master.zip
cd s3-to-ec2-master
sudo cp -r * /var/www/html/
fi
fi