include a better solution to fetch external ip

This commit is contained in:
t3chn0m4g3
2017-02-22 15:04:48 +00:00
parent 3099f6f3f3
commit 7036a7fc77
2 changed files with 97 additions and 2 deletions

View File

@ -2,8 +2,7 @@
# Let's add the first local ip to the /etc/issue and external ip to ews.ip file
source /etc/environment
myLOCALIP=$(hostname -I | awk '{ print $1 }')
#myEXTIP=$(dig +short myip.opendns.com @resolver1.opendns.com)
myEXTIP=$(curl -s whatismyip.akamai.com)
myEXTIP=$(/usr/bin/myip.sh)
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