From 5eb9368064a74b406e4e91fa13721aec984973bc Mon Sep 17 00:00:00 2001 From: Dave <12233528+kawaiipantsu@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:31:08 +0100 Subject: [PATCH] Update updateip.sh Make sure to target root partition, Debian will often come with /boot/efi or similar. This little hack will utilize regular expression to match line starting with / but having a blank after. So only root partition should match. --- bin/updateip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/updateip.sh b/bin/updateip.sh index da1aca96..c63a3e64 100755 --- a/bin/updateip.sh +++ b/bin/updateip.sh @@ -3,7 +3,7 @@ # 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 }') +myUUID=$(lsblk -o MOUNTPOINT,UUID | grep -e "^/ " | awk '{ print $2 }') myLOCALIP=$(hostname -I | awk '{ print $1 }') myEXTIP=$(/opt/tpot/bin/myip.sh) if [ "$myEXTIP" = "" ];