From 708d6fecc6fc89a131a220705627e6d43a14f849 Mon Sep 17 00:00:00 2001 From: Leon Haag-Fank Date: Fri, 5 Apr 2024 13:20:18 +0200 Subject: [PATCH] fixed docker entrypoint bash --- docker-entrypoint.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index cf16dec..857a302 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,7 +1,12 @@ -#!/bin/sh +#!/bin/bash -[[ -n "$ZEITDL_UID" || -n "$ZEITDL_GID" ]] && chown_arg='-q' -if out=$(python ./zeit-dl "$ZEITDL_USER" "$ZEITDL_PASSWORD" ${ZEITDL_OPTIONS:=-o /data} $chown_arg); then - [[ -n "$ZEITDL_UID" ]] && chown $ZEITDL_UID "$out" - [[ -n "$ZEITDL_GID" ]] && chgrp $ZEITDL_GID "$out" +if [[ -n "$ZEITDL_UID" || -n "$ZEITDL_GID" ]]; then + echo "Running zeit-dl with --quiet to get output path for chown/chgrp..." + out=$(python ./zeit-dl "$ZEITDL_USER" "$ZEITDL_PASSWORD" ${ZEITDL_OPTIONS:=-o /data} --quiet) + if [[ -n "$out" ]]; then + [[ -n "$ZEITDL_UID" ]] && chown $ZEITDL_UID "$out" + [[ -n "$ZEITDL_GID" ]] && chgrp $ZEITDL_GID "$out" + fi +else + python ./zeit-dl "$ZEITDL_USER" "$ZEITDL_PASSWORD" ${ZEITDL_OPTIONS:=-o /data} fi