Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
2eefc40d
Commit
2eefc40d
authored
Dec 11, 2019
by
Francesc Guasch
Browse files
feature(cli): remove domain
parent
146af242
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/rvd_back.pl
View file @
2eefc40d
...
...
@@ -47,6 +47,7 @@ my $LIST;
my
$HIBERNATE_DOMAIN
;
my
$START_DOMAIN
;
my
$SHUTDOWN_DOMAIN
;
my
$REMOVE_DOMAIN
;
my
$REBASE
;
my
$RUN_REQUEST
;
...
...
@@ -80,6 +81,7 @@ my $USAGE = "$0 "
.
"
--start
\n
"
.
"
--hibernate machine
\n
"
.
"
--shutdown machine
\n
"
.
"
--remove machine
\n
"
.
"
\n
"
.
"
Operations modifiers:
\n
"
.
"
--all : execute on all virtual machines
\n
"
...
...
@@ -106,6 +108,7 @@ GetOptions ( help => \$help
,'
url-isos=s
'
=>
\
$URL_ISOS
,'
shutdown:s
'
=>
\
$SHUTDOWN_DOMAIN
,'
hibernate:s
'
=>
\
$HIBERNATE_DOMAIN
,'
remove:s
'
=>
\
$REMOVE_DOMAIN
,'
disconnected
'
=>
\
$DISCONNECTED
,'
remove-user=s
'
=>
\
$REMOVE_USER
,'
make-admin=s
'
=>
\
$MAKE_ADMIN_USER
...
...
@@ -443,6 +446,20 @@ sub hibernate {
if
!
$domain_name
&&
!
$found
;
}
sub
remove_domain
{
my
$domain_name
=
shift
;
my
$rvd_back
=
Ravada
->
new
(
%CONFIG
);
my
$domain
=
$rvd_back
->
search_domain
(
$domain_name
);
die
"
Error: domain
$domain_name
not found
\n
"
if
!
$domain
;
Ravada::
Request
->
remove_domain
(
uid
=>
Ravada::Utils::
user_daemon
()
->
id
,
name
=>
$domain
->
name
);
print
"
Removing
$domain_name
\n
";
}
sub
start_domain
{
my
$domain_name
=
shift
;
...
...
@@ -607,6 +624,7 @@ rebase() if $REBASE;
list
(
$ALL
)
if
$LIST
;
hibernate
(
$HIBERNATE_DOMAIN
,
$ALL
)
if
defined
$HIBERNATE_DOMAIN
;
remove_domain
(
$REMOVE_DOMAIN
)
if
defined
$REMOVE_DOMAIN
;
start_domain
(
$START_DOMAIN
)
if
$START_DOMAIN
;
shutdown_domain
(
$SHUTDOWN_DOMAIN
,
$ALL
,
$HIBERNATED
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment