Revision 1093
Added by Aaron Marcuse-Kubitza about 13 years ago
bin/env_password | ||
---|---|---|
3 | 3 | |
4 | 4 |
self="$(readlink -f -- "$BASH_SOURCE")" |
5 | 5 | |
6 |
set -o pipefail |
|
7 | ||
6 | 8 |
test -t 2 && ccTty= || ccTty=1 # cc the tty if stderr is a log file |
7 | 9 |
{ |
8 | 10 |
store= |
... | ... | |
33 | 35 |
read -s -p "Enter $desc: "; echo |
34 | 36 |
export "$1"="$REPLY" |
35 | 37 |
fi |
36 |
} 2>&1|tee ${ccTty:+/dev/tty} >&2 |
|
38 |
} 2>&1|tee ${ccTty:+/dev/tty} >&2 || exit |
map | ||
---|---|---|
13 | 13 |
test -n "$in_host" || export in_host=localhost |
14 | 14 |
if test -z "$in_user"; then |
15 | 15 |
if test _"$(hostname)" = _nimoy -a _"$in_engine" = _MySQL; then |
16 |
. "$bin/env_password" mysql_password "your MySQL password" || exit
|
|
17 |
# exit if password not set
|
|
16 |
. "$bin/env_password" mysql_password "your MySQL password" |
|
17 |
# will exit this script if password not set
|
|
18 | 18 |
export in_user="$USER" in_password="$mysql_password" |
19 | 19 |
if test "$in_database" = SALVIAS; then in_database=salvias_plots |
20 | 20 |
elif test "$in_database" = NYBG; then in_database=bien2_staging |
... | ... | |
26 | 26 |
fi |
27 | 27 |
test "$out_database" = vegbien && . "$bin/vegbien_dest" |
28 | 28 | |
29 |
"$bin/map" "$@" |
|
29 |
exec "$bin/map" "$@" |
Also available in: Unified diff
env_password: Fixed bug where exit command would not cause it to exit, because pipefail shell option was not set. Moved automatic exiting of the calling script into env_password itself.