[ -n "$id" ] || return 0
if [ "$family" == "ipv4" ]; then
-
- ubus call network.interface.${1}_4 status &>/dev/null
- if [ "$?" -eq "0" ]; then
+ if ubus call network.interface.${1}_4 status &>/dev/null; then
network_get_ipaddr src_ip ${1}_4
else
network_get_ipaddr src_ip $1
fi
if [ "$family" == "ipv6" ]; then
-
- ubus call network.interface.${1}_6 status &>/dev/null
- if [ "$?" -eq "0" ]; then
+ if ubus call network.interface.${1}_6 status &>/dev/null; then
network_get_ipaddr6 src_ipv6 ${1}_6
else
network_get_ipaddr6 src_ipv6 $1
[ -n "$id" ] || return 0
if [ "$family" == "ipv4" ]; then
- ubus call network.interface.${1}_4 status &>/dev/null
- if [ "$?" -eq "0" ]; then
+ if ubus call network.interface.${1}_4 status &>/dev/null; then
network_get_gateway route_args ${1}_4
else
network_get_gateway route_args $1
fi
if [ "$family" == "ipv6" ]; then
-
- ubus call network.interface.${1}_6 status &>/dev/null
- if [ "$?" -eq "0" ]; then
+ if ubus call network.interface.${1}_6 status &>/dev/null; then
network_get_gateway6 route_args ${1}_6
else
network_get_gateway6 route_args $1