#!/bin/bash # 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) 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 tee /data/ews/conf/ews.ip << EOF [MAIN] ip = $myEXTIP EOF echo $myLOCALIP > /data/elk/logstash/mylocal.ip chown tpot:tpot /data/ews/conf/ews.ip if [ -f /var/run/check.lock ]; then rm /var/run/check.lock fi