]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
wlanap.cgi: Don't try to show status if there is no interface
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Sep 2024 11:16:44 +0000 (13:16 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 8 Oct 2024 08:45:34 +0000 (08:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/wlanap.cgi

index 5a22c7f259f9a252d5444cf0f253023fc543548e..b5052ac5392ed1b89de0c0ce4d4313c35bd96c8d 100644 (file)
@@ -354,29 +354,33 @@ END
 
 &Header::closebox();
 
-&Header::opensection();
+if ($INTF) {
 
-my @status = `iw dev $INTF info`;
+       &Header::opensection();
 
-if (@status) {
-       print <<END;
-               <h6>$Lang::tr{'wlanap wlan status'}</h6>
+       my @status = `iw dev $INTF info`;
+
+       if (@status) {
+               print <<END;
+                       <h6>$Lang::tr{'wlanap wlan status'}</h6>
 
-               <pre>@status</pre>
+                       <pre>@status</pre>
 END
-}
+       }
 
-my @status = `iw dev $INTF station dump`;
+       @status = `iw dev $INTF station dump`;
 
-if (@status) {
-       print <<END;
-               <h6>$Lang::tr{'wlanap clients'}</h6>
+       if (@status) {
+               print <<END;
+                       <h6>$Lang::tr{'wlanap clients'}</h6>
 
-               <pre>@status</pre>
+                       <pre>@status</pre>
 END
+       }
+
+       &Header::closesection();
 }
 
-&Header::closesection();
 &Header::closebigbox();
 &Header::closepage();