Is there a more elegant way to iterate over UCI entries using shell/bash? The code below seems a little excessive, I wouldn't think it would need to take 2+ calls to walk down an array/list..
I tried doing things like uci show dhcp.@host[@] or dhcp.@host[*], but none seem to work.
for entry in ` **uci -N show dhcp | egrep '.ip=' | cut -d. -f1-2 ** `; do
echo -ne "` uci get ${entry}.mac ` "
echo ` uci get ${entry}.name `
done
It works and occupies 4 strings, so it is nice solution. In any case you should call uci show, uci get. You can access array elements like uci get aaa.@bbb[0] The main problem is to get length of array.