iface: improve extract ip

This commit is contained in:
Jesús 2020-05-31 23:17:04 -05:00
parent a500fa42b8
commit 343e89812a
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -54,7 +54,7 @@ then
fi
# 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
3) echo -n "$IPADDR" | xclip -q -se c ;;