mirror of
https://github.com/linuxserver/docker-unifi-network-application.git
synced 2024-11-09 23:24:08 -08:00
Merge pull request #23 from linuxserver/check-for-mongo-reachability
check for mongodb reachability during init
This commit is contained in:
commit
ec5536dd30
|
@ -22,7 +22,10 @@ done
|
|||
if [[ ! -e /config/data/system.properties ]]; then
|
||||
if [[ -z "${MONGO_HOST}" ]]; then
|
||||
echo "*** No MONGO_HOST set, cannot configure database settings. ***"
|
||||
exit 1
|
||||
sleep infinity
|
||||
elif ! nc -w1 "${MONGO_HOST}" ${MONGO_PORT} >/dev/null 2>&1; then
|
||||
echo "*** Defined MONGO_HOST is not reachable, cannot proceed. ***"
|
||||
sleep infinity
|
||||
else
|
||||
sed -i "s/~MONGO_USER~/${MONGO_USER}/" /defaults/system.properties
|
||||
sed -i "s/~MONGO_HOST~/${MONGO_HOST}/" /defaults/system.properties
|
||||
|
|
Loading…
Reference in a new issue