-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·52 lines (43 loc) · 1.47 KB
/
docker-entrypoint.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
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -e
if [ -z "$@" ]; then
if [ ! -f /etc/tine20/config.inc.php ]; then
cp /opt/tine20/config.inc.php_dist /etc/tine20/config.inc.php
fi
if [ "$TINE20_DB_HOST" ]; then
sed -i "s/ENTER DATABASE HOSTNAME/$TINE20_DB_HOST/" /etc/tine20/config.inc.php
else
sed -i "s/ENTER DATABASE HOSTNAME/mysql-server/" /etc/tine20/config.inc.php
fi
if [ "$TINE20_DB_NAME" ]; then
sed -i "s/ENTER DATABASE NAME/$TINE20_DB_NAME/" /etc/tine20/config.inc.php
else
sed -i "s/ENTER DATABASE NAME/tine20/" /etc/tine20/config.inc.php
fi
if [ "$TINE20_DB_USER" ]; then
sed -i "s/ENTER DATABASE USERNAME/$TINE20_DB_USER/" /etc/tine20/config.inc.php
else
sed -i "s/ENTER DATABASE USERNAME/tine20/" /etc/tine20/config.inc.php
fi
if [ "$TINE20_DB_PASS" ]; then
sed -i "s/ENTER DATABASE PASSWORD/$TINE20_DB_PASS/" /etc/tine20/config.inc.php
else
sed -i "s/ENTER DATABASE PASSWORD//" /etc/tine20/config.inc.php
fi
if [ "$TINE20_SETUP_USER" ]; then
sed -i "s/SETUP USERNAME/$TINE20_SETUP_USER/" /etc/tine20/config.inc.php
else
sed -i "s/SETUP USERNAME/tine20setup/" /etc/tine20/config.inc.php
fi
if [ "$TINE20_SETUP_PASS" ]; then
sed -i "s/SETUP PASSWORD/$TINE20_SETUP_PASS/" /etc/tine20/config.inc.php
else
sed -i "s/SETUP PASSWORD//" /etc/tine20/config.inc.php
fi
/usr/sbin/cron
touch /opt/tine20/tine20.log
chown www-data /opt/tine20/tine20.log /etc/tine20/config.inc.php
tail -f /opt/tine20/tine20.log &
/usr/sbin/apache2ctl -e info -DFOREGROUND
fi
exec "$@"