From 3a050d36d3127f08690f44c4ae0c7fc6e46e9267 Mon Sep 17 00:00:00 2001 From: anni57779821988 <134767082+anni57779821988@users.noreply.github.com> Date: Sat, 27 May 2023 09:05:01 +0200 Subject: [PATCH] Create holdon --- holdon | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 holdon diff --git a/holdon b/holdon new file mode 100644 index 0000000..c6ebfa0 --- /dev/null +++ b/holdon @@ -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}