mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-01 12:32:12 +00:00
Lookup external IP
This commit is contained in:
parent
fa92b2ea09
commit
c36d014e07
1 changed files with 5 additions and 3 deletions
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
# Let's add the first local ip to the /etc/issue and ews.ip file
|
# Let's add the first local ip to the /etc/issue and ews.ip file
|
||||||
myIP=$(hostname -I | awk '{ print $1 }')
|
# export http_proxy=http://your.proxy.server:port/
|
||||||
sed -i "s#IP:.*#IP: $myIP#" /etc/issue
|
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
|
tee /data/ews/conf/ews.ip << EOF
|
||||||
[MAIN]
|
[MAIN]
|
||||||
ip = $myIP
|
ip = $myEXTIP
|
||||||
EOF
|
EOF
|
||||||
if [ -f /var/run/check.lock ];
|
if [ -f /var/run/check.lock ];
|
||||||
then rm /var/run/check.lock
|
then rm /var/run/check.lock
|
||||||
|
|
Loading…
Reference in a new issue