/ag-listusers
#!/usr/bin/perl

use AwesomeGrid::User;

my $hostname = shift;
opendir USERS, "$AwesomeGrid::confdir/users";
my @users = grep {/^[^.]/} readdir USERS;
closedir USERS;
printf "%-10s%-20s\n","username","home system";
printf '-' x 30;
printf "\n";
foreach (@users) {
	my $agu = AwesomeGrid::User->load($_);
	if ($hostname) {
		next unless $agu->{home} eq $hostname;
	}
	printf "%-10s%-20s\n", $agu->{username}, $agu->{home};
}