Copied from https://hacks.mozilla.org/2017/02/headless-raspberry-pi-configuration-over-bluetooth/
Once you have the image mounted, and you are at the command prompt, you can start editing the configuration files necessary to get us going.
Let’s start by creating the main script that will set up and establish the default Bluetooth services and serial port you will connect to on startup.
You’ll create this file in the /home/pi directory, like so:
$ sudo nano /home/pi/btserial.sh