From c36d014e0794fc175a71063b53580400a25d4f20 Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Thu, 5 Feb 2015 14:03:27 +0100 Subject: [PATCH] Lookup external IP --- installer/etc/rc.local | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/installer/etc/rc.local b/installer/etc/rc.local index e4884080..7e108c75 100755 --- a/installer/etc/rc.local +++ b/installer/etc/rc.local @@ -1,10 +1,12 @@ #!/bin/sh -e # Let's add the first local ip to the /etc/issue and ews.ip file -myIP=$(hostname -I | awk '{ print $1 }') -sed -i "s#IP:.*#IP: $myIP#" /etc/issue +# export http_proxy=http://your.proxy.server:port/ +myLOCALIP=$(hostname -I | awk '{ print $1 }') +myEXTIP=$(curl myexternalip.com/raw) +sed -i "s#IP:.*#IP: $myLOCALIP, $myEXTIP#" /etc/issue tee /data/ews/conf/ews.ip << EOF [MAIN] -ip = $myIP +ip = $myEXTIP EOF if [ -f /var/run/check.lock ]; then rm /var/run/check.lock