Lookup external IP

This commit is contained in:
t3chn0m4g3 2015-02-05 14:03:27 +01:00
parent fa92b2ea09
commit c36d014e07

View file

@ -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