Topic: uci -P/var/state get network.wan.ipaddr

uci -P/var/state get network.wan.ipaddr
give me
uci: Entry not found

I am KabelBW customer and use OpenWrt on a router behind the DOCSIS-Modem.

Logread shows me:
Jun  5 13:53:49 OpenWrt daemon.notice netifd: wan (739): Sending renew...
Jun  5 13:53:49 OpenWrt daemon.notice netifd: wan (739): Lease of x.x.x.x obtained, lease time 3600

How come the variable is empty?

Re: uci -P/var/state get network.wan.ipaddr

The uci state vars are deprecated and not used anymore for network related information.
Use /lib/functions/network.sh:

source /lib/functions/network.sh

if network_get_ipaddr addr "wan"; then
    echo "IP is $addr"
fi

Re: uci -P/var/state get network.wan.ipaddr

thx