]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/wlanap.cgi
hostap: Allow to use Automatic Channel Selection (ACS)
[ipfire-2.x.git] / html / cgi-bin / wlanap.cgi
index 44b0b405327eef213765e2c92615bfc9ae61a0fb..5120e2eae7d4acee40af03a566350fa320844e09 100644 (file)
@@ -270,7 +270,7 @@ if ( -d '/sys/class/net/mon.'.$wlanapsettings{'INTERFACE'} ) {
 }
 
 my @channellist_cmd;
-my @channellist;
+my @channellist = (0);
 
 if ( $wlanapsettings{'DRIVER'} eq 'NL80211' ){
 my $wiphy = `iw dev $wlanapsettings{'INTERFACE'} info | grep wiphy | cut -d" " -f2`;
@@ -285,7 +285,7 @@ $_ =~ /(.*) \[(\d+)(.*)\]/;
 $channel = $2;chomp $channel;
 if ( $channel =~ /\d+/ ){push(@temp,$channel + 0);}
 }
-@channellist = @temp;
+push(@channellist, @temp);
 } else {
 @channellist_cmd = `iwlist $monwlaninterface channel|tail -n +2 2>/dev/null`;
 # get available channels
@@ -296,7 +296,7 @@ $_ =~ /(.*)Channel (\d+)(.*):/;
 $channel = $2;chomp $channel;
 if ( $channel =~ /\d+/ ){push(@temp,$channel + 0);}
 }
-@channellist = @temp;
+push(@channellist, @temp);
 }
 
 my @countrylist_cmd = `regdbdump /usr/lib/crda/regulatory.bin 2>/dev/null`;
@@ -414,7 +414,13 @@ if ( scalar @channellist > 0 ){
 END
 ;
        foreach $channel (@channellist){
-               print "<option $selected{'CHANNEL'}{$channel}>$channel</option>";
+               print "<option $selected{'CHANNEL'}{$channel}>";
+               if ($channel eq 0) {
+                       print "- $Lang::tr{'wlanap auto'} -";
+               } else {
+                       print $channel;
+               }
+               print "</option>";
        }
        print "</select></td></tr>"
 } else {