forked from monkey-company/php-apache-certbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint-custom
88 lines (72 loc) · 1.58 KB
/
entrypoint-custom
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
87
88
#!/bin/bash
set -e
#start script
if [ "$1" = 'run' ]
then
#sh /scripts/init.sh
apt-get update
#google pagespeed option
if [ "$PAGESPEED" = "true" ]
then
sh /scripts/pagespeed.sh
else
echo "Without pagespeed";
fi
#install additionnal dependencies
IFS=',' read -r -a libarr <<< "$LIBMOD"
for libel in "${libarr[@]}"
do
apt-get install $libel -y
done
#install php mods
IFS=',' read -r -a phparr <<< "$PHPMOD"
for phpel in "${phparr[@]}"
do
apt-get install php-$phpel -y
done
sh /scripts/before-pecl.sh
#update pecl repository
printf "\n" | pecl channel-update pecl.php.net
#install pecl mods
IFS=',' read -r -a peaarr <<< "$PEAMOD"
for peael in "${peaarr[@]}"
do
printf "\n" | pecl install $peael
done
#disable apache modules
IFS=',' read -r -a apdarr <<< "$APDMOD"
for apdel in "${apdarr[@]}"
do
a2dismod -f $apdel
done
#enable apache modules
IFS=',' read -r -a apaarr <<< "$APAMOD"
for apael in "${apaarr[@]}"
do
a2enmod $apael
done
apt-get autoremove -y
#set fqdn
if ! grep -q "ServerName" /etc/apache2/apache2.conf; then
echo "ServerName 0.0.0.0" >> /etc/apache2/apache2.conf
fi
#run other script (cron, modules, etc)
if [ ! -f "$SHFILE" ]
then
echo "file not found"
else
chmod +x $SHFILE
echo "run $SHFILE"
$SHFILE
fi
#apply changes
service apache2 start
#documentation
sh /scripts/doc.sh
echo "Apache log :"
tail -n 3 -f /var/log/apache2/* | grep --line-buffered '.*' | while read LINE0
do
echo "${LINE0}";
done
fi
#end script