Last active
September 7, 2019 17:07
-
-
Save xxmatyuk/cc2bd1d2cef0fcf7980ebf29feb47b7f to your computer and use it in GitHub Desktop.
Pi post boot script
This file contains 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 | |
# Parse args | |
ssid="$1" | |
password="$2" | |
# Create Wi-Fi config | |
cat > wpa_supplicant.conf <<EOF | |
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
country=US | |
network={ | |
ssid="${ssid}" | |
psk="${password}" | |
key_mgmt=WPA-PSK | |
} | |
EOF | |
# Make Pi ssh-accessible | |
echo '' > ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment