Index: trunk/Nebulous/bin/neb-df
===================================================================
--- trunk/Nebulous/bin/neb-df	(revision 13074)
+++ trunk/Nebulous/bin/neb-df	(revision 17079)
@@ -3,5 +3,5 @@
 # Copyright (C) 2007  Joshua Hoblitt
 #
-# $Id: neb-df,v 1.3 2007-04-28 01:19:59 jhoblitt Exp $
+# $Id: neb-df,v 1.4 2008-03-21 01:36:59 jhoblitt Exp $
 
 use strict;
@@ -11,12 +11,10 @@
 $VERSION = '0.01';
 
-use DBI;
-use Nebulous::Server::SQL;
-use URI;
+use Nebulous::Client;
 
 use Getopt::Long qw( GetOptions :config auto_help auto_version );
 use Pod::Usage qw( pod2usage );
 
-my ($db, $dbuser, $dbpass, $name, $uri);
+my ($db, $dbuser, $dbpass);
 
 $db     = $ENV{'NEB_DB'} unless $db;
@@ -34,33 +32,21 @@
     unless $db && $dbuser && $dbpass;
 
-my $dbh = DBI->connect(
-    "DBI:mysql:database=$db:host=localhost",
-    $dbuser,
-    $dbpass,
-    {
-        RaiseError => 1,
-        PrintError => 0,
-        AutoCommit => 1,
-    },
+my $neb = Nebulous::Client->new(
+    proxy => "$server",
 );
 
-my $sql = Nebulous::Server::SQL->new();
+die "can't connected to Nebulous Server: $server"
+    unless defined $neb;
 
-# ask the db to generate the table of mounted Nebulous volume 
-$dbh->do("call getmountedvol()");
-
-# suck that table into an AoH
-my $query = $dbh->prepare("SELECT * FROM mountedvol");
-$query->execute();
-
-my @stats;
-while (my $mountedvol = $query->fetchrow_hashref) {
-    push @stats, $mountedvol;
-}
+my $stats = $neb->mounts();
 
 # output a summary of the information in a vaguely POSIX df like format
 print "Filesystem           1K-blocks      Used Available Use% Mounted on\n";
 
-foreach my $vol (@stats) {
+foreach my $row (@$stats) {
+    my %vol;
+    @vol{qw(mountpoint total used vol_id name path allocate available xattr)}
+        = @$row;
+
     my $path        = $vol->{path};
     my $total       = $vol->{total};
