Skip to content

Commit

Permalink
May pass owner of imported domain in arg
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol committed Nov 20, 2017
1 parent ebcb88e commit 0a12b72
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bin/rvd_back.pl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
my $START_DOMAIN;
my $SHUTDOWN_DOMAIN;

my $IMPORT_DOMAIN_OWNER;

my $USAGE = "$0 "
." [--debug] [--config=$FILE_CONFIG_DEFAULT] [--add-user=name] [--add-user-ldap=name]"
." [--change-password] [--make-admin=username] [--import-vbox=image_file.vdi]"
Expand All @@ -48,6 +50,7 @@
." --add-user-ldap : adds a new LDAP user\n"
." --change-password : changes the password of an user\n"
." --import-domain : import a domain\n"
." --import-domain-owner : owner of the domain to import\n"
." --make-admin : make user admin\n"
." --config : config file, defaults to $FILE_CONFIG_DEFAULT"
." -X : start in foreground\n"
Expand Down Expand Up @@ -87,6 +90,7 @@
,'add-user-ldap=s'=> \$ADD_USER_LDAP
,'import-domain=s' => \$IMPORT_DOMAIN
,'import-vbox=s' => \$IMPORT_VBOX
,'import-domain-owner=s' => \$IMPORT_DOMAIN_OWNER
) or exit;

$START = 1 if $DEBUG || $FILE_CONFIG || $NOFORK;
Expand Down Expand Up @@ -258,9 +262,12 @@ sub remove_admin {
sub import_domain {
my $name = shift;
print "Virtual Manager: KVM\n";
print "User name that will own the domain in Ravada : ";
my $user = <STDIN>;
chomp $user;
my $user = $IMPORT_DOMAIN_OWNER;
if (!$user) {
print "User name that will own the domain in Ravada : ";
$user = <STDIN>;
chomp $user;
}
my $ravada = Ravada->new( %CONFIG );
$ravada->import_domain(name => $name, vm => 'KVM', user => $user);
}
Expand Down

0 comments on commit 0a12b72

Please sign in to comment.