forked from azlux/botamusique
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
64 lines (50 loc) · 1.39 KB
/
entrypoint.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
command=( "${@}" )
if [ "$1" == "bash" ] || [ "$1" == "sh" ]; then
exec "${@}"
fi
if [ -n "$BAM_DB" ]; then
command+=( "--db" "$BAM_DB" )
fi
if [ -n "$BAM_MUSIC_DB" ]; then
command+=( "--music-db" "$BAM_MUSIC_DB" )
fi
if [ -n "$BAM_MUMBLE_SERVER" ]; then
command+=( "--server" "$BAM_MUMBLE_SERVER")
fi
if [ -n "$BAM_MUMBLE_PASSWORD" ]; then
command+=( "--password" "$BAM_MUMBLE_PASSWORD" )
fi
if [ -n "$BAM_MUMBLE_PORT" ]; then
command+=( "--port" "$BAM_MUMBLE_PORT" )
fi
if [ -n "$BAM_USER" ]; then
command+=( "--user" "$BAM_USER" )
fi
if [ -n "$BAM_TOKENS" ]; then
command+=( "--tokens" "$BAM_TOKENS" )
fi
if [ -n "$BAM_CHANNEL" ]; then
command+=( "--channel" "$BAM_CHANNEL" )
fi
if [ -n "$BAM_CERTIFICATE" ]; then
command+=( "--cert" "$BAM_CERTIFICATE" )
fi
if [ -n "$BAM_VERBOSE" ]; then
command+=( "--verbose" )
fi
if [ -n "$BAM_BANDWIDTH" ]; then
command+=( "--bandwidth" "$BAM_BANDWIDTH")
fi
if [ -n "$BAM_CONFIG_file" ]; then
if [ ! -f "$BAM_CONFIG_file" ]; then
cp "/botamusique/configuration.example.ini" "$BAM_CONFIG_file"
fi
command+=( "--config" "$BAM_CONFIG_file" )
else
if [ ! -f "/botamusique/configuration.ini" ]; then
cp "/botamusique/configuration.example.ini" "/botamusique/configuration.ini"
fi
command+=( "--config" "/botamusique/configuration.ini" )
fi
exec "${command[@]}"