From 14a9b09f745ae103ebd21540d96733881ad57960 Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Thu, 24 Mar 2022 12:01:36 +0000 Subject: [PATCH] dynamic display of issue text --- bin/updateip.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/updateip.sh b/bin/updateip.sh index a4c7875b..07be28e2 100755 --- a/bin/updateip.sh +++ b/bin/updateip.sh @@ -2,6 +2,7 @@ # Let's add the first local ip to the /etc/issue and external ip to ews.ip file # If the external IP cannot be detected, the internal IP will be inherited. source /etc/environment +myCHECKIFSENSOR=$(head -n 1 /opt/tpot/etc/tpot.yml | grep "Sensor" | wc -l) myUUID=$(lsblk -o MOUNTPOINT,UUID | grep "/" | awk '{ print $2 }') myLOCALIP=$(hostname -I | awk '{ print $1 }') myEXTIP=$(/opt/tpot/bin/myip.sh) @@ -51,7 +52,10 @@ echo ",---- [ \n ] [ \d ] [ \t ]" >> /etc/issue echo "|" >> /etc/issue echo "| IP: $myLOCALIP ($myEXTIP)" >> /etc/issue echo "| SSH: ssh -l tsec -p 64295 $myLOCALIP" >> /etc/issue -echo "| WEB: https://$myLOCALIP:64297" >> /etc/issue +if [ "$myCHECKIFSENSOR" == "0" ]; + then + echo "| WEB: https://$myLOCALIP:64297" >> /etc/issue +fi echo "| ADMIN: https://$myLOCALIP:64294" >> /etc/issue echo "$myBLACKHOLE_STATUS" >> /etc/issue echo "|" >> /etc/issue