iface: improve extract ip

This commit is contained in:
Jesús
2020-05-31 23:17:04 -05:00
parent a500fa42b8
commit 343e89812a

View File

@@ -54,7 +54,7 @@ then
fi fi
# Check local ip address # Check local ip address
IPADDR=$(ip -f inet addr show dev "$IF" | sed -n 's/^ *inet *\([.0-9]*\).*/\1/p') IPADDR=$(ip route get 4.2.2.1 | grep -oE "src [.0-9]+" | awk '{print $NF;exit}')
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
3) echo -n "$IPADDR" | xclip -q -se c ;; 3) echo -n "$IPADDR" | xclip -q -se c ;;