Nice! Great script, more robust then the little one i made, mine only did a few things.
I created the script by using SSH, then issuing:
touch pineapple-setup.sh
Then ran
chmod +x pineapple-setup.sh
Then ran it ./pineapple-mk4-setup-script.sh
As someone else pointed out you can do the last two in the same run
# chmod +x pineapple-setup.sh; ./pineapple-setup.sh