Project

General

Profile

1 262 aaronmk
#!/bin/bash
2
# Runs map with BIEN defaults
3
4
selfDir="$(dirname -- "$0")"
5 1092 aaronmk
bin="$selfDir/bin"
6 262 aaronmk
7
shopt -s nullglob
8
9 272 aaronmk
bien_password="$(cat "$selfDir/config/bien_password")"
10 262 aaronmk
11
# Defaults
12
if test -n "$in_engine"; then
13
    test -n "$in_host" || export in_host=localhost
14
    if test -z "$in_user"; then
15
        if test _"$(hostname)" = _nimoy -a _"$in_engine" = _MySQL; then
16 1093 aaronmk
            . "$bin/env_password" mysql_password "your MySQL password"
17
                # will exit this script if password not set
18 262 aaronmk
            export in_user="$USER" in_password="$mysql_password"
19 957 aaronmk
            if test "$in_database" = SALVIAS; then in_database=salvias_plots
20 1299 aaronmk
            else in_database=bien2_staging
21 957 aaronmk
            fi
22 262 aaronmk
        else
23
            export in_user=bien in_password="$bien_password"
24
        fi
25
    fi
26
fi
27 1092 aaronmk
test "$out_database" = vegbien && . "$bin/vegbien_dest"
28 262 aaronmk
29 1093 aaronmk
exec "$bin/map" "$@"