From 01d4ef29285dccbcb3c3f6b6752699d2a566c44f Mon Sep 17 00:00:00 2001 From: Marco Ochse Date: Fri, 21 Jul 2017 15:26:37 +0000 Subject: [PATCH] account for unresolved external ip address --- installer/bin/updateip.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/installer/bin/updateip.sh b/installer/bin/updateip.sh index 7b64eb94..f9c0892a 100755 --- a/installer/bin/updateip.sh +++ b/installer/bin/updateip.sh @@ -1,8 +1,13 @@ #!/bin/bash # Let's add the first local ip to the /etc/issue and external ip to ews.ip file +# If the external IP cannot be detected, the internal IP will be inherited. source /etc/environment myLOCALIP=$(hostname -I | awk '{ print $1 }') myEXTIP=$(/usr/share/tpot/bin/myip.sh) +if [ "$myEXTIP" = "" ]; + then + myEXTIP=$myLOCALIP +fi sed -i "s#IP:.*#IP: $myLOCALIP ($myEXTIP)#" /etc/issue sed -i "s#SSH:.*#SSH: ssh -l tsec -p 64295 $myLOCALIP#" /etc/issue sed -i "s#WEB:.*#WEB: https://$myLOCALIP:64297#" /etc/issue @@ -12,7 +17,8 @@ ip = $myEXTIP EOF tee /etc/tpot/elk/environment << EOF MY_EXTIP=$myEXTIP +MY_INTIP=$myLOCALIP MY_HOSTNAME=$HOSTNAME EOF -echo $myLOCALIP > /data/elk/logstash/mylocal.ip chown tpot:tpot /data/ews/conf/ews.ip +chmod 760 /data/ews/conf/ews.ip