Merge pull request #1428 from RaspAP/fix/dev-capabilities

Fix: More robust method to parse phy from selected interface
This commit is contained in:
Bill Zimmerman 2023-10-23 10:48:32 +02:00 committed by GitHub
commit e85e403169
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ if (isset($_POST['interface'])) {
$flags = 0;
// get physical device for selected interface
exec("iw dev | awk '/$iface/ {print line}{line = $0}'", $return);
exec("iw dev | awk -v iface=".$iface." '/^phy#/ { phy = $0 } $1 == \"Interface\" { interface = $2 } interface == iface { print phy }'", $return);
$phy = $return[0];
// get frequencies supported by device