mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
Merge remote-tracking branch 'stevee/wlan-client' into next
Conflicts: config/cfgroot/general-functions.pl
This commit is contained in:
@@ -1008,4 +1008,26 @@ sub MakeUserAgent() {
|
||||
return $user_agent;
|
||||
}
|
||||
|
||||
sub RedIsWireless() {
|
||||
# This function checks if a network device is a wireless device.
|
||||
|
||||
my %settings = ();
|
||||
&readhash("${General::swroot}/ethernet/settings", \%settings);
|
||||
|
||||
# Find the name of the network device.
|
||||
my $device = $settings{'RED_DEV'};
|
||||
|
||||
# Exit, if no device is configured.
|
||||
return 0 if ($device eq "");
|
||||
|
||||
# Return 1 if the device is a wireless one.
|
||||
my $path = "/sys/class/net/$device/wireless";
|
||||
if (-d $path) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Otherwise return zero.
|
||||
return 0;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -157,6 +157,10 @@ sub genmenu {
|
||||
if ( $ethsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $ethsettings{'RED_TYPE'} eq 'STATIC' ) {
|
||||
$menu->{'03.network'}{'subMenu'}->{'70.aliases'}{'enabled'} = 1;
|
||||
}
|
||||
|
||||
if (&General::RedIsWireless()) {
|
||||
$menu->{'01.system'}{'subMenu'}->{'21.wlan'}{'enabled'} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub showhttpheaders
|
||||
|
||||
Reference in New Issue
Block a user