Not sure who maintains the upgrade,.sh for Plexamp Headless, but there a two additions that would be helpful: 1) check if the latest version is already insytalled and 2) check that jq is installed n the system (its not on piOS bullseye)
Attached is my script with these revisions.
upgrade.sh.zip (1.3 KB)