Browse Source

lookup hostname when in docker

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

9
lgsm/functions/command_monitor.sh

@ -33,8 +33,13 @@ for queryattempt in {1..5}; do
fi
querystatus="$?"
elif [ "${querymethod}" == "tcp" ]; then
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
querystatus="$?"
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

Loading…
Cancel
Save