From d8034f41560e644772634df3f0e289b85c88033e Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sat, 5 Dec 2015 22:17:28 -0800 Subject: [PATCH] Get last IP listed for interface --- gravity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 170774c..043b313 100755 --- a/gravity.sh +++ b/gravity.sh @@ -13,7 +13,7 @@ if [[ -f $piholeIPfile ]];then else # Otherwise, the IP address can be taken directly from the machine, which will happen when the script is run by the user and not the installation script IPv4dev=$(ip route get 8.8.8.8 | awk '{print $5}') - piholeIPCIDR=$(ip -o -f inet addr show dev $IPv4dev | awk '{print $4}') + piholeIPCIDR=$(ip -o -f inet addr show dev $IPv4dev | awk '{print $4}') | sed -n '$p' piholeIP=${piholeIPCIDR%/*} fi