forked from pmietlicki/docker-sogo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsogod.sh
executable file
·29 lines (23 loc) · 928 Bytes
/
sogod.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
#!/bin/bash
set -eo pipefail
mkdir -p /var/run/sogo
touch /var/run/sogo/sogo.pid
chown -R sogo:sogo /var/run/sogo
#Solve libssl bug for Mail View
if [[ -z "${LD_PRELOAD}" ]]; then
LIBSSL_LOCATION=$(find /lib /usr/lib /usr/local/lib -type f -name "libssl.so.*" -print -quit)
grep -q "^LD_PRELOAD" /etc/default/sogo || echo "LD_PRELOAD=$LIBSSL_LOCATION" >>/etc/default/sogo
export LD_PRELOAD=$LIBSSL_LOCATION
else
echo "LD_PRELOAD=$LD_PRELOAD" >>/etc/default/sogo
export LD_PRELOAD=$LD_PRELOAD
fi
# Copy back administrator's configuration
cp -L /srv/etc/sogo.conf /etc/sogo/sogo.conf
# Create SOGo home directory if missing
mkdir -p /srv/lib/sogo
chown -R sogo /srv/lib/sogo
# Load crontab
cp -L /srv/etc/cron /etc/cron.d/sogo
# Run SOGo in foreground
LD_PRELOAD=$LD_PRELOAD exec /sbin/setuser sogo /usr/sbin/sogod -WOUseWatchDog $USEWATCHDOG -WONoDetach YES -WOPort "127.0.0.1:20000" -WOPidFile /var/run/sogo/sogo.pid