blob: 2fd55180b983296fffbc4ba2f7361481ada6a1fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/bash
# Set needed environment variables and do basic checks.
function hydra_set_env {
export CONFIG="$HOME/.hydra/config"
export ACTION="$1"
if [ ! -z "$HYDRA" ]; then
export PREFERENCES="$HOME/.hydra/$HYDRA"
fi
}
# Read a parameter from user
function hydra_user_input {
local input
param="$1"
default="$2"
shift 2
read -rep "$* (defaults to $default): " input
if [ -z "$input" ]; then
export $param=$default
else
export $param=$input
fi
}
|