Browse Source

lookup hostname when in docker

pull/2101/head
Josh 7 years ago
parent
commit
48a803e439
  1. 5
      lgsm/functions/command_monitor.sh

5
lgsm/functions/command_monitor.sh

@ -33,9 +33,14 @@ for queryattempt in {1..5}; do
fi
querystatus="$?"
elif [ "${querymethod}" == "tcp" ]; then
if [ -f /.dockerenv ]; then
bash -c 'exec 3<> /dev/tcp/'$(hostname -i)'/'${queryport}''
querystatus="$?"
else
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
querystatus="$?"
fi
fi
if [ "${querystatus}" == "0" ]; then
# Server query OK

Loading…
Cancel
Save