Now I understand what a login shell is and how a shell script can run in one - all the commands working. Doh Baz! :)

The most important thing is that the script works when I SSH in to my Raspberry Pi. Running unattended can wait for another day. :)

https://github.com/bazbt3/raspberrypisetup?files=1