diff options
| author | Tslil Clingman <hiato1@gmail.com> | 2013-03-26 15:19:47 +0200 |
|---|---|---|
| committer | Tslil Clingman <hiato1@gmail.com> | 2013-03-26 15:19:47 +0200 |
| commit | 8c19617946822d7aeac61696294f893d5e5eca6f (patch) | |
| tree | c4df5faffc6b335b2c48e2fadd7d6125a33a6056 /wls | |
Init scripts
Diffstat (limited to 'wls')
| -rwxr-xr-x | wls | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#!/bin/bash + +dird="${HOME}/.config/wireless" + +sudo killall wpa_supplicant &> /dev/null +sudo dhcpcd -k wlan0 &> /dev/null + +ls $dird +echo -n "--> " +read ssid + +if [ ! -f "$dird/$ssid" ]; then + echo Creating new network profile, enter passphrase: + read pass + wpa_passphrase $ssid $pass > $dird/$ssid + echo "Edit file (y/[n])? " + read edit + if [ "$edit" == "y" ]; then + $EDITOR $dird/$ssid + fi; +fi; + +sudo wpa_supplicant -B -i wlan0 -c "$dird/$ssid" +sleep 3s +sudo dhcpcd wlan0 |
