I had attempted to create a pass for my local library in the past, but never got a working barcode, and this post helped me to understand the issues I was hitting.
I was able to adapt the OP's shell script to generate a working Codabar image (after I figured out that my local library used "A" and "T" as beginning and end markers) that matched the physical card exactly, and there was enough useful metadata for me to piece together a working pass using that barcode as a store card's background image. I ended up using the Pass2U Wallet iOS app directly, rather than hacking around signing keys, but found the documented process helpful.