partition and format local ssd in start script

If you are willing to take a chance that the SSD is always at /dev/sdb and that fdisk doesn't change their user interface, you can simply run fdisk and supply fdisk's input in an EOF block as follows:

#!/bin/bash
sleep 30
fdisk /dev/sdb <<EOF
n
p
1


w
EOF
mkfs.ext4 -F /dev/sdb1
mkdir /tmp/ssd
mount /dev/sdb1 /tmp/ssd
chmod 777 /tmp/ssd

The fdisk input is n for new, p for system partition, then 1 for partition 1, two blank lines to accept the defaults from fdisk, then w to write the partition table.