Skip to content

Instantly share code, notes, and snippets.

@dittmaraz
Created July 14, 2019 08:53
Show Gist options
  • Save dittmaraz/7bb9390328e243c84da90c235c1d4c39 to your computer and use it in GitHub Desktop.
Save dittmaraz/7bb9390328e243c84da90c235c1d4c39 to your computer and use it in GitHub Desktop.
This script enables a Raspberry Pi Zero W for headless configuration.
#!/bin/sh
# This script enables a Raspberry Pi Zero W for headless configuration.
clear
lsblk
read -p "Enter the path to your SDcard: " SDCARDPATH
# TODO: Validate SDCARDPATH
cd $SDCARDPATH
read -p "Enter name of network: " NONET
read -p "Enter network password: " NOPASS
tee wpa_supplicant.conf <<EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="$NONET"
psk="$NOPASS"
scan_ssid=1
}
EOF
echo "enable_uart=1" >>config.txt
touch ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment