wok-current diff ocsinventory-agent/stuff/Drives.pm.u @ rev 11982
no extensions in desktop files
author | Samuel Trassare <samuel_trassare@yahoo.com> |
---|---|
date | Fri Mar 02 15:57:49 2012 -0800 (2012-03-02) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ocsinventory-agent/stuff/Drives.pm.u Fri Mar 02 15:57:49 2012 -0800 1.3 @@ -0,0 +1,47 @@ 1.4 +--- Ocsinventory-Agent-1.0.1.ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm Fri Mar 6 19:02:57 2009 1.5 ++++ Ocsinventory-Agent-1.0.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm Sun Jul 12 22:29:32 2009 1.6 +@@ -1,9 +1,11 @@ 1.7 + package Ocsinventory::Agent::Backend::OS::Linux::Drives; 1.8 ++# Modified bye Erjo <erjo@slitaz.org> 1.9 ++# Busybox df applet as no -T -P options. 1.10 + 1.11 + use strict; 1.12 + sub check { 1.13 + return unless can_run ("df"); 1.14 +- my $df = `df -TP`; 1.15 ++ my $df = `df -k`; 1.16 + return 1 if $df =~ /\w+/; 1.17 + 0 1.18 + } 1.19 +@@ -19,14 +21,14 @@ 1.20 + my $volumn; 1.21 + 1.22 + 1.23 +- foreach(`df -TP`) { # TODO retrive error 1.24 +- if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){ 1.25 ++ foreach(`df -k`) { # TODO retrive error 1.26 ++ if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){ 1.27 + $free = sprintf("%i",($4/1024)); 1.28 +- $filesystem = $2; 1.29 +- $total = sprintf("%i",($3/1024)); 1.30 +- $type = $1; 1.31 +- $volumn = $5; 1.32 +- 1.33 ++ $filesystem = $1; 1.34 ++ $total = sprintf("%i",($2/1024)); 1.35 ++ $type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;; 1.36 ++ $volumn = $6; 1.37 ++ 1.38 + # no virtual FS 1.39 + next if ($type =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/); 1.40 + next if ($filesystem =~ /^(tmpfs)$/); 1.41 +@@ -36,8 +38,7 @@ 1.42 + FILESYSTEM => $filesystem, 1.43 + TOTAL => $total, 1.44 + TYPE => $type, 1.45 +- VOLUMN => 1.46 +- $volumn 1.47 ++ VOLUMN => $volumn 1.48 + }) 1.49 + } 1.50 + }