Skip to content

Commit 5eb9368

Browse files
authored
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.
1 parent 72a3b51 commit 5eb9368

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/updateip.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# If the external IP cannot be detected, the internal IP will be inherited.
44
source /etc/environment
55
myCHECKIFSENSOR=$(head -n 1 /opt/tpot/etc/tpot.yml | grep "Sensor" | wc -l)
6-
myUUID=$(lsblk -o MOUNTPOINT,UUID | grep "/" | awk '{ print $2 }')
6+
myUUID=$(lsblk -o MOUNTPOINT,UUID | grep -e "^/ " | awk '{ print $2 }')
77
myLOCALIP=$(hostname -I | awk '{ print $1 }')
88
myEXTIP=$(/opt/tpot/bin/myip.sh)
99
if [ "$myEXTIP" = "" ];

0 commit comments

Comments
 (0)