# find interface from wpa_supplicant-*.conf files
for f in /etc/wpa_supplicant/wpa_supplicant-*.conf \
	/etc/wpa_supplicant-*.conf; do
	case "$f" in *"/wpa_supplicant-*.conf") continue ;; esac
	iface=${f#*/wpa_supplicant-}
	if [ -z "$AUTO" ]; then
		AUTO="${AUTO} -c ${f} -i ${iface%.conf}"
	else
		AUTO="${AUTO} -N -c ${f} -i ${iface%.conf}"
	fi
done

# match all configuration
[ -r /etc/wpa_supplicant/wpa_supplicant.conf ] &&
	AUTO="${AUTO} -M -c /etc/wpa_supplicant/wpa_supplicant.conf"
