Skip to content

Instantly share code, notes, and snippets.

@fionn
Created March 28, 2017 18:23
Show Gist options
  • Save fionn/48531574f06b4796afcd9e73bc18c6f0 to your computer and use it in GitHub Desktop.
Save fionn/48531574f06b4796afcd9e73bc18c6f0 to your computer and use it in GitHub Desktop.
make drone's WPA configuration persistent
#!/bin/sh
# Append
# /home/default/wpa.sh &
# to /bin/wifi_setup.sh
# The desired IP address for the drone
ADDRESS="192.168.x.y"
# WPA credentials for the new network
ESSID="some_ssid"
PASSWORD="password"
wpa_passphrase $ESSID $PASSWORD > /etc/wpa_supplicant.conf
# shorten this when everything is confirmed working
sleep 100
{ ifconfig ath0 $ADDRESS; iwconfig ath0 essid '$ESSID' && wpa_supplicant -B -Dwext -iath0 -c/etc/wpa_supplicant.conf; } &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment