UCI command usage

I've read the wiki on UCI but it did not go into details about some more complex UCI commands that i've found around the forums and I had some questions on how to enter them.

Here is a code block i was going to try to input into my shell:

for OUTPUT in $(ip -o -6 addr list br-lan scope global | awk '{ split($4, ip_addr, "/"); print ip_addr[1] }')
do
	echo "Adding $OUTPUT to IPV6 DNS"
	uci add_list dhcp.lan.dns=$OUTPUT
done

Do I enter that entire block at once and hit enter into the shell? Or do I enter line 1, and then enter the block from line 2 to line 4?

Is there a wiki on UCI that i've somehow missed that details these sorts of multi-line commands?

Thanks in advance!

Click on the code block. You should see a “copy” icon on top right. Click on it and you should see a “copied”. Paste that into a terminal and hit enter.

1 Like

Ok so in that example I can copy and enter the entire code block all at once?

It’s an in line script. You’ll likely see > at beginning of subsequent lines in terminal to indicate each CR with the cursor ending at the end. When you enter, the script executes.

1 Like