1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-06 15:36:40 +00:00
Felix Bartels 8d0a0fd8f5
Add wrapper scripts to easily get admin.cfg (#331)
* add small wrapper scripts to honor admin.cfg at /tmp/kopano
* add script to create stores (workaround to satisfy tests)
* add output of orphaned store list to startup test
2020-02-04 08:07:49 +01:00

40 lines
851 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
cronfile=/tmp/crontab
# purge existing entries from crontab
true > "$cronfile"
for cronvar in ${!CRON_*}; do
cronvalue=${!cronvar}
echo "Adding $cronvalue to crontab"
echo "$cronvalue" >> "$cronfile"
done
for cronvar in ${!CRONDELAYED_*}; do
cronvalue=${!cronvar}
echo "Adding $cronvalue to crontab (delayed)"
echo "$cronvalue" >> "$cronfile"
done
# wait for kopano_server statup to run one-off commands
dockerize \
-wait tcp://kopano_server:236 \
-timeout 360s
echo "Creating public store"
docker exec kopano_server kopano-storeadm -h default: -P || true
echo "Running sheduled cron jobs once"
for cronvar in ${!CRON_*}; do
cronvalue=${!cronvar}
croncommand=$(echo "$cronvalue" | cut -d ' ' -f 6-)
echo "Running: $croncommand"
$croncommand
done
supercronic -test $cronfile
exec supercronic $cronfile