fixed docker entrypoint bash

This commit is contained in:
Leon Haag-Fank 2024-04-05 13:20:18 +02:00
parent 4c1557d53a
commit 708d6fecc6

View file

@ -1,7 +1,12 @@
#!/bin/sh #!/bin/bash
[[ -n "$ZEITDL_UID" || -n "$ZEITDL_GID" ]] && chown_arg='-q' if [[ -n "$ZEITDL_UID" || -n "$ZEITDL_GID" ]]; then
if out=$(python ./zeit-dl "$ZEITDL_USER" "$ZEITDL_PASSWORD" ${ZEITDL_OPTIONS:=-o /data} $chown_arg); then echo "Running zeit-dl with --quiet to get output path for chown/chgrp..."
[[ -n "$ZEITDL_UID" ]] && chown $ZEITDL_UID "$out" out=$(python ./zeit-dl "$ZEITDL_USER" "$ZEITDL_PASSWORD" ${ZEITDL_OPTIONS:=-o /data} --quiet)
[[ -n "$ZEITDL_GID" ]] && chgrp $ZEITDL_GID "$out" 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 fi