Somehow the output of the API call must have changed over time. It now includes a count value before the encap array data, which will lead to an error when processing it with jq.

Please update wiki the page with a different jq filter, c.f. how I fixed the script on our system. I am ignoring the count value.

root@host:~# diff -U1 get-encap.sh-orig get-encap.sh

--- get-encap.sh-orig   2024-02-01 11:24:31.725642496 -0800

+++ get-encap.sh        2024-02-01 11:24:53.421227002 -0800

@@ -24,3 +24,3 @@

 curl -s https://user:key@portal.ampr.org/api/v1/encap > json-data.out

-cat json-data.out |  jq -r '.[] | "route addprivate \(.network)/\(.maskLength) encap \(.gatewayIP)"' >> encap.txt

+cat json-data.out |  jq -r '.encap[] | "route addprivate \(.network)/\(.maskLength) encap \(.gatewayIP)"' >> encap.txt

root@host:~#


Thanks, andreas K6OTT