mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-04-28 11:18:51 +00:00
prevent race condition for ewsposter/ews.ip at first start
This commit is contained in:
parent
ebb58955c4
commit
8165e8f91f
2 changed files with 14 additions and 0 deletions
|
@ -71,3 +71,7 @@ nodeid =
|
|||
iptableslog =
|
||||
targetip =
|
||||
|
||||
[EMOBILITY]
|
||||
eMobility = false
|
||||
nodeid = emobility-community-01
|
||||
logfile = /data/emobility/emobility.log
|
||||
|
|
|
@ -332,6 +332,16 @@ update-initramfs -u
|
|||
sed -i 's#\#force_color_prompt=yes#force_color_prompt=yes#' /home/tsec/.bashrc
|
||||
sed -i 's#\#force_color_prompt=yes#force_color_prompt=yes#' /root/.bashrc
|
||||
|
||||
# Let's create ews.ip before reboot and prevent race condition for first start
|
||||
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
|
||||
[MAIN]
|
||||
ip = $myEXTIP
|
||||
EOF
|
||||
chown tpot:tpot /data/ews/conf/ews.ip
|
||||
|
||||
# Final steps
|
||||
fuECHO "### Thanks for your patience. Now rebooting."
|
||||
mv /root/tpot/etc/rc.local /etc/rc.local && rm -rf /root/tpot/ && chage -d 0 tsec && sleep 2 && reboot
|
||||
|
|
Loading…
Reference in a new issue