Skip to content

Instantly share code, notes, and snippets.

@sammachin
Last active December 21, 2018 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sammachin/d5b4ce8e5112f87228a7c4bfbf1cf9ad to your computer and use it in GitHub Desktop.
Save sammachin/d5b4ce8e5112f87228a7c4bfbf1cf9ad to your computer and use it in GitHub Desktop.
PI Starter
#! /bin/bash
CARDPATH=$1
#Enable SSH
touch $CARDPATH/ssh
#Configure WiFi
cp wpa_supplicant.conf $CARDPATH/wpa_supplicant.conf
#Enable USB Networking (pi zero)
echo "dtoverlay=dwc2" >> $CARDPATH/config.txt
sed -e 's/rootwait/& modules-load=dwc2,g_ether/' -i .backup $CARDPATH/cmdline.txt
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK"
psk="PASSWORD"
}
@sammachin
Copy link
Author

CARDPATH is the path to the SD card mounted on your mac eg /Volumes/BOOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment