fix problem with ext ip resolving

This commit is contained in:
Marco Ochse 2017-02-15 14:26:28 +01:00 committed by GitHub
parent 41a3b610eb
commit 5f12ea7543

View file

@ -2,7 +2,7 @@
# Let's add the first local ip to the /etc/issue and external ip to ews.ip file # Let's add the first local ip to the /etc/issue and external ip to ews.ip file
source /etc/environment source /etc/environment
myLOCALIP=$(hostname -I | awk '{ print $1 }') myLOCALIP=$(hostname -I | awk '{ print $1 }')
myEXTIP=$(curl -s myexternalip.com/raw) myEXTIP=$(dig +short myip.opendns.com @resolver1.opendns.com)
sed -i "s#IP:.*#IP: $myLOCALIP ($myEXTIP)#" /etc/issue 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#SSH:.*#SSH: ssh -l tsec -p 64295 $myLOCALIP#" /etc/issue
sed -i "s#WEB:.*#WEB: https://$myLOCALIP:64297#" /etc/issue sed -i "s#WEB:.*#WEB: https://$myLOCALIP:64297#" /etc/issue