@xNUTx Thanks for the script. FWIW, you can extract the LAN IP easily by using uci show network.lan.ipaddr.
uci show network.lan.ipaddr