[arch-general] Exiting wpa_supplicant

Gaetan Bisson bisson at archlinux.org
Mon Oct 22 17:49:14 EDT 2012


[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


More information about the arch-general mailing list