2015-12-08 14:47:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Let's add the first local ip to the /etc/issue and external ip to ews.ip file
|
|
|
|
source /etc/environment
|
2015-02-05 13:03:27 +00:00
|
|
|
myLOCALIP=$(hostname -I | awk '{ print $1 }')
|
2017-02-22 14:21:10 +00:00
|
|
|
#myEXTIP=$(dig +short myip.opendns.com @resolver1.opendns.com)
|
|
|
|
myEXTIP=$(curl -s whatismyip.akamai.com)
|
2016-08-08 00:21:02 +00:00
|
|
|
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
|
2015-01-28 16:08:34 +00:00
|
|
|
tee /data/ews/conf/ews.ip << EOF
|
|
|
|
[MAIN]
|
2015-02-05 13:03:27 +00:00
|
|
|
ip = $myEXTIP
|
2015-01-28 16:08:34 +00:00
|
|
|
EOF
|
2016-06-18 22:20:02 +00:00
|
|
|
echo $myLOCALIP > /data/elk/logstash/mylocal.ip
|
2015-03-03 14:59:20 +00:00
|
|
|
chown tpot:tpot /data/ews/conf/ews.ip
|
2015-01-28 16:08:34 +00:00
|
|
|
if [ -f /var/run/check.lock ];
|
|
|
|
then rm /var/run/check.lock
|
|
|
|
fi
|