From: Arne Fitzenreiter Date: Sat, 6 Jul 2013 09:50:01 +0000 (+0200) Subject: Merge remote-tracking branch 'stevee/wlan-client' into next X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=commitdiff_plain;h=57097305a610383d013c87ef32ae117c18846e46 Merge remote-tracking branch 'stevee/wlan-client' into next Conflicts: config/cfgroot/general-functions.pl --- 57097305a610383d013c87ef32ae117c18846e46 diff --cc config/cfgroot/general-functions.pl index 90eacbdb0,3a04369e3..3cdb36fbd --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@@ -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 () { + $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;