From 63835d37231794527b6999fac1d50321c631044e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 30 Jan 2013 19:13:50 -0200 Subject: Provision: checking and getting user input when config is not set; new config 'disable_zeroing'; function rename --- lib/hydra/misc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/hydra/misc') 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 -- cgit v1.2.3