Created
October 4, 2016 23:00
-
-
Save nrobinson2000/ba5552cdd423951e1ac0dc23cbfc34e9 to your computer and use it in GitHub Desktop.
Alpha phase setup script for Raspberry Pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "Raspberry Pi Alpha Setup tool:" | |
| echo | |
| echo "Installing Screen..." | |
| sudo apt-get install screen | |
| echo | |
| read -rp "Enter your Device ID: " deviceID | |
| echo "$deviceID" > device_id.txt | |
| openssl genrsa 1024 | openssl rsa -outform DER -out device_key.der | |
| curl https://s3.amazonaws.com/spark-website/cloud_public.der -o server_key.der | |
| curl https://binaries.particle.io/raspberrypi/tinker -o firmware.bin | |
| chmod +x firmware.bin | |
| echo " | |
| #!/bin/bash | |
| cd /home/$USER | |
| sudo ./firmware.bin -v 70 -i "$(cat device_id.txt)" | |
| " > particle.sh | |
| chmod +x particle.sh | |
| echo | |
| echo "Put the following inside of your \"/etc/rc.local\" file so that your pi will run tinker at boot: | |
| echo | |
| echo "screen -dmS particle /home/$USER/particle.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment