Skip to content

Commit

Permalink
Create holdon
Browse files Browse the repository at this point in the history
  • Loading branch information
anni57779821988 authored May 27, 2023
1 parent b1e9c67 commit 3a050d3
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions holdon
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/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}"
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}

0 comments on commit 3a050d3

Please sign in to comment.