Project

General

Profile

« Previous | Next » 

Revision 1951

env_password: return instead of exit if password not yet stored, in case user is running it from a shell without the initial "-" argument. (This would be the case if the user is just testing out the script, instead of using a command that env_password directs them to run.)

View differences:

bin/env_password
33 33
        }|tee ${ccTty:+/dev/tty} >&2
34 34
    fi
35 35
    
36
    test -z "$store" && exit 1 # just direct user how to store password
36
    test -z "$store" && return 1 # just direct user how to store password
37 37
    read -s -p "Enter $desc: "; echo
38 38
    export "$1"="$REPLY"
39 39
fi
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"
17
                # will exit this script if password not set
16
            . "$bin/env_password" mysql_password "your MySQL password" || exit
17
                # 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
            else in_database=bien2_staging

Also available in: Unified diff