-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup
More file actions
46 lines (36 loc) · 1.07 KB
/
startup
File metadata and controls
46 lines (36 loc) · 1.07 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
#!/bin/bash
# Starup script for environment setup and apache start.
# Author: Pali ondras@webmax.sk - based on Andy Smith MMK Digital
export TERM=dumb
echo "Starting MySQL..."
/etc/init.d/mysql start
sleep 5
echo "Starting apache..."
apache2ctl start
if [ -e /var/www/public/composer.json ];
then
echo "Running composer install..."
mycomposer install
fi
if [ -e /var/www/utils/remote.sspak.phar ];
then
echo "SSPAK: loading remote.sspak.phar..."
mysspak load remote
fi
if [ ! -d /var/www/public/assets ];
then
echo "Setup assets dir..."
mkdir /var/www/public/assets
chown www-data:www-data -R /var/www/public/assets
chmod 775 -R /var/www/public/assets
fi
if [ ! -e /var/www/public/assets/.htaccess ];
then
echo "Setup assets/.htaccess..."
wget -O /var/www/public/assets/.htaccess https://raw.githubusercontent.com/silverstripe/silverstripe-installer/master/assets/.htaccess
chown www-data:www-data /var/www/public/assets/.htaccess
chmod 775 -R /var/www/public/assets/.htaccess
fi
echo "ALL DONE"
# do not exit container after startup
while true; do sleep 1000; done