#!/bin/sh # Finds the highest settings an AP can support for various settings when set to "auto" in config find_auto_hwmode() { # This function finds the highest mode (hw_mode) that the AP can support # Arguments device=$1 mode='11n' iw phy "$device" info | grep -q 'VHT Capabilities*' && mode="11ac" iw phy "$device" info | grep -q 'HE.*Capabilities' && mode="11ax" echo "$mode" } find_auto_hwmode $1