init MySQL database only if MYSQL_SERVER is filled

This commit is contained in:
Tophe 2018-09-14 20:26:22 +02:00
parent 179be6694b
commit c5b642ab4f

View file

@ -1,14 +1,16 @@
#!/bin/bash
source /usr/local/bin/common.sh
source /usr/local/bin/mysql.sh
for conf in $(printenv| grep -i SOGO_ | cut -d= -f1);do
update_conf "${conf:5}" "${!conf}"
done
wait_for_db
init_db
if [[ -n ${MYSQL_SERVER//[[:blank:]]/} ]]; then
source /usr/local/bin/mysql.sh
wait_for_db
init_db
fi
log_info "Launching SOGo"
/usr/sbin/sogod -WONoDetach YES -WOPort 20000 -WOLogFile - -WOPidFile /tmp/sogo.pid