[F] Fix macOS route on VPN hangs

https://github.com/dylanaraps/neofetch/pull/2362
This commit is contained in:
Azalea 2023-08-14 20:19:11 -07:00
parent 116c83b513
commit 75750f12a5

View file

@ -4934,7 +4934,7 @@ get_local_ip() {
"Mac OS X" | "macOS" | "iPhone OS") "Mac OS X" | "macOS" | "iPhone OS")
if [[ "${local_ip_interface[0]}" == "auto" ]]; then if [[ "${local_ip_interface[0]}" == "auto" ]]; then
interface="$(route get 1 | awk -F': ' '/interface/ {printf $2; exit}')" interface="$(route -n get 1 | awk -F': ' '/interface/ {printf $2; exit}')"
local_ip="$(ipconfig getifaddr "$interface")" local_ip="$(ipconfig getifaddr "$interface")"
else else
for interface in "${local_ip_interface[@]}"; do for interface in "${local_ip_interface[@]}"; do