In a normal linux environment we can do
gateway=`netstat -rn | grep ^0\.0\.0\.0 | awk '{
print $2
}
'`
or
gateway=$(netstat -rn | grep ^0\.0\.0\.0 | awk '{
print $2
}
')
but since Android's busybox/magisk doesn't support netstat -rn
, what other commands can we use to get the gateway or router ip?