#!%PERL% -w


use strict;

use lib '%VHFFS_LIB_DIR%';
use Vhffs::Conf;
use Vhffs::User;
use Vhffs::Group;
use Vhffs::Main;
use Vhffs::Object;

my $princ = init Vhffs::Main;

die("Usage: $0 username password\n") unless(@ARGV == 2);

my ($username, $password) = @ARGV;

die("User $username already exists\n") if(Vhffs::User::exists($princ, $username));

my $user = Vhffs::User::create($princ, $username, $password);

if( !defined $user )
{
	die "Unable to create user $username\n";
}
else
{
	print "User $username created!\n";
}

exit;
