summaryrefslogtreecommitdiffstats
path: root/bin/launch
blob: 5ae25a4a1a2d07d39715d89e66cdfa6e9d5613f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
set -eu
set -o pipefail

script_path="$(realpath "$(dirname "$0")")"
secrets_bin="${script_path}/secrets"

case "$1" in
    base|tozt|algo|mail|partofme)
        "$secrets_bin" open
        trap '"$secrets_bin" close' EXIT
        "$(dirname "$0")/helpers/launch-$1"
        ;;
    *)
        echo "unknown host $1" >&2
        exit 1
        ;;
esac