From b165dcdd803ba278013b1af03a8269f8994cb5f7 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 20 Sep 2024 13:16:44 +0200 Subject: [PATCH] wlanap.cgi: Don't try to show status if there is no interface Signed-off-by: Michael Tremer --- html/cgi-bin/wlanap.cgi | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/html/cgi-bin/wlanap.cgi b/html/cgi-bin/wlanap.cgi index 5a22c7f25..b5052ac53 100644 --- a/html/cgi-bin/wlanap.cgi +++ b/html/cgi-bin/wlanap.cgi @@ -354,29 +354,33 @@ END &Header::closebox(); -&Header::opensection(); +if ($INTF) { -my @status = `iw dev $INTF info`; + &Header::opensection(); -if (@status) { - print <$Lang::tr{'wlanap wlan status'} + my @status = `iw dev $INTF info`; -
@status
+ if (@status) { + print <$Lang::tr{'wlanap wlan status'} + +
@status
END + } + + @status = `iw dev $INTF station dump`; + + if (@status) { + print <$Lang::tr{'wlanap clients'} + +
@status
+END + } + + &Header::closesection(); } -my @status = `iw dev $INTF station dump`; - -if (@status) { - print <$Lang::tr{'wlanap clients'} - -
@status
-END -} - -&Header::closesection(); &Header::closebigbox(); &Header::closepage();