-
Notifications
You must be signed in to change notification settings - Fork 9
/
entrypoint.sh
50 lines (42 loc) · 1.4 KB
/
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
#!/bin/sh +x
ZPUSH_CONFIG='/var/www/html/config.php'
#Prepare config file
if [ ! -f "${ZPUSH_CONFIG}.bkp" ]; then
# Backun original file
cp $ZPUSH_CONFIG $ZPUSH_CONFIG.bkp
cat <<- EOF >> $ZPUSH_CONFIG
#Zimbra config
define('MAPI_SERVER', 'file:///var/run/zarafa');
define('ZPUSH_URL', '');
define('ZIMBRA_URL','');
define('ZIMBRA_USER_DIR','zimbra');
define('ZIMBRA_SYNC_CONTACT_PICTURES', true);
define('ZIMBRA_VIRTUAL_CONTACTS',true);
define('ZIMBRA_VIRTUAL_APPOINTMENTS',true);
define('ZIMBRA_VIRTUAL_NOTES',true);
define('ZIMBRA_VIRTUAL_TASKS',true);
define('ZIMBRA_IGNORE_EMAILED_CONTACTS',true);
define('ZIMBRA_HTML',true);
define('ZIMBRA_ENFORCE_VALID_EMAIL',false);
define('ZIMBRA_SMART_FOLDERS',false);
EOF
fi
if [ -z $ZPUSH_URL_IN_HTTP ]; then
ZPUSH_URL_PROTO="https:\/\/"
else
ZPUSH_URL_PROTO="http:\/\/"
fi
if [ -z $ZIMBRA_URL_IN_HTTP ]; then
ZIMBRA_URL_PROTO="https:\/\/"
else
ZIMBRA_URL_PROTO="http:\/\/"
fi
# Config Zimbra backend
sed -i "/BACKEND_PROVIDER/s/'[^']*'/'BackendZimbra'/2" $ZPUSH_CONFIG
sed -i "/ZPUSH_URL/s/'[^']*'/'$ZPUSH_URL_PROTO$ZPUSH_URL\/Microsoft-Server-ActiveSync'/2" $ZPUSH_CONFIG
sed -i "/ZIMBRA_URL/s/'[^']*'/'$ZIMBRA_URL_PROTO$ZIMBRA_URL'/2" $ZPUSH_CONFIG
# Set timezone if exist
if [ ! -z $TIMEZONE ]; then
sed -i "/TIMEZONE/s/'[^']*'/'$TIMEZONE'/2" $ZPUSH_CONFIG
fi
apache2-foreground