11 lines
244 B
Bash
11 lines
244 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
if [ "$#" -ne 2 ]; then
|
||
|
echo "Usage: connect.sh: <ssid> <psk>"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
/usr/bin/wpa_passphrase "$1" "$2" > /etc/wpa_supplicant.conf
|
||
|
/usr/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
|
||
|
/usr/sbin/dhclient wlan0
|