Skip to content
Snippets Groups Projects
Commit bdc92b87 authored by micah's avatar micah :speech_balloon:
Browse files

r240@um: micah | 2005-12-27 14:54:04 -0500

 If vservers weren't enabled it was impossible to enter the src
 menu in ninjahelper due to how these functions returned. This sets
 the variable host_or_vserver='host' when vservers are not available
 and then returns with a nice exit code
parent 104b663a
Branches
Tags
No related merge requests found
...@@ -88,14 +88,18 @@ choose_one_vserver() { ...@@ -88,14 +88,18 @@ choose_one_vserver() {
} }
## ##
## If Vservers are not enabled, exit silently. ## If Vservers are not enabled, set host_or_vservers='host' and then return
## Else, have the user choose if he/she wants to perform the backup on the host ## Else, have the user choose if he/she wants to perform the backup on the host
## system or on one Vserver. ## system or on one Vserver.
## Set, respectively, $host_or_vservers to 'host' or 'vservers'. ## Set, respectively, $host_or_vservers to 'host' or 'vservers'.
## Returns 1 if cancelled. ## Returns 1 if cancelled.
## ##
choose_host_or_one_vserver() { choose_host_or_one_vserver() {
[ "$vservers_are_available" == "yes" ] || return if [ "$vservers_are_available" != "yes" ]
then
host_or_vservers='host'
return
fi
local title=$1 local title=$1
# if there is one, set the previously chosen item as the default # if there is one, set the previously chosen item as the default
[ -n "$host_or_vservers" ] && setDefault $host_or_vservers [ -n "$host_or_vservers" ] && setDefault $host_or_vservers
...@@ -114,7 +118,7 @@ choose_host_or_one_vserver() { ...@@ -114,7 +118,7 @@ choose_host_or_one_vserver() {
} }
## ##
## If Vservers are not enabled, exit silently. ## If Vservers are not enabled, set host_or_vservers='host' and then return
## Else, have the user choose the target he/she wants to perform the backup on: ## Else, have the user choose the target he/she wants to perform the backup on:
## - host system only; ## - host system only;
## - some vservers only; ## - some vservers only;
...@@ -123,7 +127,11 @@ choose_host_or_one_vserver() { ...@@ -123,7 +127,11 @@ choose_host_or_one_vserver() {
## Returns 1 if cancelled. ## Returns 1 if cancelled.
## ##
choose_host_or_vservers_or_both() { choose_host_or_vservers_or_both() {
[ "$vservers_are_available" == "yes" ] || return if [ "$vservers_are_available" != "yes" ]
then
host_or_vservers='host'
return
fi
local title=$1 local title=$1
# if there is one, set the previously chosen item as the default # if there is one, set the previously chosen item as the default
[ -n "$host_or_vservers" ] && setDefault $host_or_vservers [ -n "$host_or_vservers" ] && setDefault $host_or_vservers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment