diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hydra/misc | 15 |
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 |