summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-30 19:13:50 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-30 19:13:50 -0200
commit63835d37231794527b6999fac1d50321c631044e (patch)
tree2e9e3a1b155260478ecbf962001d5670425f9677 /lib
parent7d9c8ef2f108381298f83054ad656bd84723e9ea (diff)
downloadhydra-63835d37231794527b6999fac1d50321c631044e.tar.gz
hydra-63835d37231794527b6999fac1d50321c631044e.tar.bz2
Provision: checking and getting user input when config is not set; new config 'disable_zeroing'; function rename
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/misc15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc
index 7c3c955..5318ba8 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -15,8 +15,8 @@ function hydra_set_env {
# Read a parameter from user
function hydra_user_input {
local input
- param="$1"
- default="$2"
+ local param="$1"
+ local default="$2"
shift 2
if echo $param | grep -q 'passwd'; then
@@ -32,6 +32,17 @@ function hydra_user_input {
fi
}
+# Get a configuration parameter if not previously defined by a sourced file
+function hydra_user_config {
+ local param="$1"
+ local default="$2"
+ shift 2
+
+ if [ -z "`eval echo '$'$param`" ]; then
+ hydra_user_input $param $default $*
+ fi
+}
+
# Install a package
function hydra_install_package {
if [ -z "$1" ]; then