[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop: [1515]
From:       owes () users ! sourceforge ! net
Date:       2008-06-15 15:22:03
Message-ID: E1K7u3P-0003wG-1K () sc8-pr-svn4 ! sourceforge ! net
[Download RAW message or body]

Revision: 1515
          http://ipcop.svn.sourceforge.net/ipcop/?rev=1515&view=rev
Author:   owes
Date:     2008-06-15 08:22:02 -0700 (Sun, 15 Jun 2008)

Log Message:
-----------
Fix display of free space.

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/backup.cgi

Modified: ipcop/trunk/html/cgi-bin/backup.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/backup.cgi	2008-06-15 13:22:33 UTC (rev 1514)
+++ ipcop/trunk/html/cgi-bin/backup.cgi	2008-06-15 15:22:02 UTC (rev 1515)
@@ -352,12 +352,22 @@
 
 sub readfreespace()
 {
+	# df output can look like this:
+	#   Filesystem           1M-blocks      Used Available Use% Mounted on
+	#   /dev/disk/by-label/root
+	#                             304M      206M       83M  72% /
+	#
+	# or this:
+	#   Filesystem           1M-blocks      Used Available Use% Mounted on
+	#   /dev/sda                  175M       11M      156M   7% /home/httpd/html/backup
+	#
+	# find the correct line & cut it to pieces. We want the Available column.
 	my $space=0;
 	if ($mounted eq $Lang::tr{'local hard disk'}) {
 		# not able to run awk from the GUI
-		$space=`/bin/df -B M / | /bin/grep dev | /usr/bin/cut -d M -f3`;
+		$space=`/bin/df -B M / | /bin/grep -v Filesystem | /bin/grep M | /usr/bin/cut -d M \
-f3`;  } else {
-		$space=`/bin/df -B M /dev/$mounted | /bin/grep dev | /usr/bin/cut -d M -f3`;
+		$space=`/bin/df -B M /dev/$mounted | /bin/grep -v Filesystem  | /bin/grep M | \
/usr/bin/cut -d M -f3`;  }
 	return $space;
 }


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic