From 798f327d02a81578df9a7e3f414bcb73167e47f6 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:08:03 +0100 Subject: [PATCH] Update --- autobrr/Dockerfile | 8 ++++---- autobrr/rootfs/entrypoint.sh | 16 ++++++++++++++++ autobrr/rootfs/etc/cont-init.d/91-run.sh | 4 ++++ autobrr/rootfs/etc/entrypoint.sh | 16 ++++++++++++++++ 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 autobrr/rootfs/entrypoint.sh create mode 100644 autobrr/rootfs/etc/cont-init.d/91-run.sh create mode 100644 autobrr/rootfs/etc/entrypoint.sh diff --git a/autobrr/Dockerfile b/autobrr/Dockerfile index 0939afa7b..cb7b04611 100644 --- a/autobrr/Dockerfile +++ b/autobrr/Dockerfile @@ -95,11 +95,11 @@ RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get # 4 Entrypoint # ################ -#RUN chmod 777 /entrypoint.sh +RUN chmod 777 /entrypoint.sh #WORKDIR / -#ENTRYPOINT [ "/usr/bin/env" ] -#CMD [ "/entrypoint.sh" ] -#SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ENTRYPOINT [ "/usr/bin/env" ] +CMD [ "/entrypoint.sh" ] +SHELL ["/bin/bash", "-o", "pipefail", "-c"] ############ # 5 Labels # diff --git a/autobrr/rootfs/entrypoint.sh b/autobrr/rootfs/entrypoint.sh new file mode 100644 index 000000000..68c3fec4d --- /dev/null +++ b/autobrr/rootfs/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +echo "Starting..." + +#################### +# Starting scripts # +#################### + +for SCRIPTS in /etc/cont-init.d/*; do + [ -e "$SCRIPTS" ] || continue + echo "$SCRIPTS: executing" + chown "$(id -u)":"$(id -g)" "$SCRIPTS" + chmod a+x "$SCRIPTS" + # Change shebang if no s6 supervision + sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" + /."$SCRIPTS" || echo "$SCRIPTS: exiting $?" +done diff --git a/autobrr/rootfs/etc/cont-init.d/91-run.sh b/autobrr/rootfs/etc/cont-init.d/91-run.sh new file mode 100644 index 000000000..ba0cd24b0 --- /dev/null +++ b/autobrr/rootfs/etc/cont-init.d/91-run.sh @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash + +exec /usr/local/bin/autobrr --config /config/addons_config/autobrr \ No newline at end of file diff --git a/autobrr/rootfs/etc/entrypoint.sh b/autobrr/rootfs/etc/entrypoint.sh new file mode 100644 index 000000000..68c3fec4d --- /dev/null +++ b/autobrr/rootfs/etc/entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +echo "Starting..." + +#################### +# Starting scripts # +#################### + +for SCRIPTS in /etc/cont-init.d/*; do + [ -e "$SCRIPTS" ] || continue + echo "$SCRIPTS: executing" + chown "$(id -u)":"$(id -g)" "$SCRIPTS" + chmod a+x "$SCRIPTS" + # Change shebang if no s6 supervision + sed -i 's|/usr/bin/with-contenv bashio|/usr/bin/env bashio|g' "$SCRIPTS" + /."$SCRIPTS" || echo "$SCRIPTS: exiting $?" +done