-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
39 lines (20 loc) · 1.1 KB
/
init.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
#!/bin/bash
####### INIT SCRIPT ####
mkdir -p /root/report
date +%s >> /root/report/build-report.txt
printf "\n\n##### Beginning init-script.sh\n\n" >> /root/report/build-report.txt
mkdir -p /root/bin
pushd /root/bin
printf "\n\n## Downloading the git repo\n\n" >> /root/report/build-report.txt
wget https://github.com/bradchesney79/2017-Debian-Jessie-Secure-WebApp-Server/archive/master.zip
printf "\n\n## Unzipping the compressed git repo\n\n" >> /root/report/build-report.txt
apt-get update && apt-get -y install unzip
unzip /root/bin/master.zip
printf "\n\n## Moving the files\n\n" >> /root/report/build-report.txt
cp -R /root/bin/2017-Debian-Jessie-Secure-WebApp-Server-master/* /root/bin/
printf "\n\n## Setting consistent file permissions\n\n" >> /root/report/build-report.txt
chmod -R 770 /root/bin/*
find /root/bin/* -type d -exec chmod -R 771 {} \;
printf "\n\n## Removing spent resources\n\n" >> /root/report/build-report.txt
rm -rf /root/bin/cut-paste.txt /root/bin/favicon.ico /root/bin/init.sh /root/bin/2017-Debian-Jessie-Secure-WebApp-Server-master /root/bin/master.zip /root/bin/README.md
popd