Using --json with the jq utility would make the script more robust as well as require one fewer invocations of restic:
--json
jq