On Mon, Oct 22, 2012 at 11:57 AM, Nelson Marambio <nelsonmarambio@xxxxxx> wrote: > Dear list, > > I try to write a small shellscript that (dis-)connects me with / from the > WLAN of my university. > > 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. > > My question (in context of the wlan-disconnect-script): how can I exit > wpa_supplicant if it runs in the background ? Up to now it's done by "sudo > killall wpa_supplicant" but I guess it's not the best way. I suggest "wpa_cli terminate". See the wpa_cli manpage.