/bin/sh -c "
# By name: nothing here was started with a pidfile, and inventing one for a
# daemon that backgrounds itself would be a second thing that can be wrong.
killall wpa_cli 2>/dev/null
killall udhcpc 2>/dev/null
killall wpa_supplicant 2>/dev/null
# killall returns as soon as the signal is sent, so without this wait a
# reconnect a moment later finds the dying supplicant in the process table and
# does nothing.
n=0
while [ \$n -lt 15 ] && { pgrep -f wpa_supplicant >/dev/null 2>&1 || ps 2>/dev/null | grep wpa_supplican[t] >/dev/null; }; do
    sleep 1
    n=\$((n + 1))
done
echo 'wifi: stopped'
"
