Before this commit, I used uncommitted code that used an <<EOF or
<<'EOF' heredef block.
This did not work well, because for some reason, ubus call poe manage
would occasionally send a Ctrl+c, stopping the script. Again, no clue
how.
Notable items here:
- s function, which wraps arguments for ssh
This is a really nice function. Gemini 2.5 Pro provides a good
explanation for how the printf '%q ' bit works; tl;dr it builds a
string prepared for a single shell interpolation and dequoting.
- run all shell commands standalone
... one-by-one prevents the Ctrl+c issue.
- not documented: limit /etc/config/poe on the remote switch
... to only four ports. The new /etc/config/poe generated-default
contains too many ports for ubus call poe manage to operate quickly.
By only listing the four needed ports, ubus call poe manage runs very
quickly now -- afaict the ubox queue does not get long since there are
only four ports described to manage.