forked from pengzhile/pandora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
executable file
·46 lines (34 loc) · 987 Bytes
/
startup.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
#!/bin/bash
PANDORA_ARGS=""
PANDORA_COMMAND="pandora"
USER_CONFIG_DIR="/data"
if [ -n "${PANDORA_PROXY}" ]; then
PANDORA_ARGS="${PANDORA_ARGS} -p ${PANDORA_PROXY}"
fi
if [ -n "${PANDORA_ACCESS_TOKEN}" ]; then
mkdir -p "${USER_CONFIG_DIR}"
echo "${PANDORA_ACCESS_TOKEN}" >"${USER_CONFIG_DIR}/access_token.dat"
fi
if [ -n "${PANDORA_TOKENS_FILE}" ]; then
PANDORA_ARGS="${PANDORA_ARGS} --tokens_file ${PANDORA_TOKENS_FILE}"
fi
if [ -n "${PANDORA_SERVER}" ]; then
PANDORA_ARGS="${PANDORA_ARGS} -s ${PANDORA_SERVER}"
else
PANDORA_ARGS="${PANDORA_ARGS} -s 0.0.0.0"
fi
if [ -n "${PANDORA_API}" ]; then
PANDORA_ARGS="${PANDORA_ARGS} -a"
fi
if [ -n "${PANDORA_SENTRY}" ]; then
PANDORA_ARGS="${PANDORA_ARGS} --sentry"
fi
if [ -n "${PANDORA_VERBOSE}" ]; then
PANDORA_ARGS="${PANDORA_ARGS} -v"
fi
if [ -n "${PANDORA_CLOUD}" ]; then
PANDORA_COMMAND="pandora-cloud"
fi
export USER_CONFIG_DIR
# shellcheck disable=SC2086
$(command -v ${PANDORA_COMMAND}) ${PANDORA_ARGS}