22 Oct
2012
22 Oct
'12
11:49 p.m.
[2012-10-22 17:57:30 +0200] Nelson Marambio:
I use wpa_supplicant in combination with the -B switch to establish the connection. After a pause of 10 seconds I pull an IP address by calling dhcpcd.
This 10-second sleep is flaky. Instead, after you've started wpa_supplicant, run `wpa_cli -a /path/to/script -B` with a script roughly looking like: case "$2" in CONNECTED) [[ -f /run/dhcpcd-$1.pid ]] && dhcpcd -qx $1 dhcpcd -q $1 ;; DISCONNECTED) dhcpcd -qx $1 ;; esac -- Gaetan