Skip to content

Commit

Permalink
filter out link-local IP addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
kdoren committed Oct 9, 2020
1 parent abae9f5 commit 16d8976
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stage3/07-install-boot-script/files/urlrelay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ while [ ! "$(ping -c 1 google.com)" ]; do
done

# MY_IP=`ip -o -4 a | awk '$2 == "eth0" { gsub(/\/.*/, "", $4); print $4 }'`
MY_IP=`ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n 1`
MY_IP=`ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | grep -v 169.254. | awk '{ print $2 }' | cut -f2 -d: | head -n 1`
MACADDR=`cat /sys/class/net/eth0/address`

if [ -f /etc/urlrelay/urlrelay.conf ]; then
Expand Down

0 comments on commit 16d8976

Please sign in to comment.