]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Merge remote-tracking branch 'stevee/wlan-client' into next
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 6 Jul 2013 09:50:01 +0000 (11:50 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sat, 6 Jul 2013 11:43:51 +0000 (13:43 +0200)
Conflicts:
config/cfgroot/general-functions.pl

1  2 
config/cfgroot/general-functions.pl
config/rootfiles/common/armv5tel/initscripts
config/rootfiles/common/i586/initscripts

index 90eacbdb011487e2f4af8e60eb8cc42e249f3620,3a04369e357a652b13985afd2dc9a91a996d3367..3cdb36fbd4709229edd93b2f39893a145a17425f
@@@ -984,28 -981,26 +984,50 @@@ sub GetIcmpDescription ($) 
      if ($index>41) {return 'unknown'} else {return @icmp_description[$index]};
  }
  
 +sub GetCoreUpdateVersion() {
 +      my $core_update;
 +
 +      open(FILE, "/opt/pakfire/db/core/mine");
 +      while (<FILE>) {
 +              $core_update = $_;
 +              last;
 +      }
 +      close(FILE);
 +
 +      return $core_update;
 +}
 +
 +sub MakeUserAgent() {
 +      my $user_agent = "IPFire/$General::version";
 +
 +      my $core_update = &GetCoreUpdateVersion();
 +      if ($core_update ne "") {
 +              $user_agent .= "/$core_update";
 +      }
 +
 +      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;