External modules script

This commit is contained in:
Alexandre
2023-09-09 19:17:08 +02:00
parent 2e1a527f5a
commit f79352608d
83 changed files with 238 additions and 525 deletions

View File

@@ -50,12 +50,8 @@ COPY rootfs/ /
ARG MODULES="00-banner.sh 01-custom_script.sh 90-config_yaml.sh"
# Automatic modules download
RUN if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi \
&& if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi \
&& apt-get update && apt-get install -yqq --no-install-recommends ca-certificates || apk add --no-cache ca-certificates >/dev/null || true \
&& mkdir -p /etc/cont-init.d \
&& for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done \
&& chmod -R 755 /etc/cont-init.d || printf '%s\n' "${MODULES}" >/MODULESFILE
ADD --chmod=744 "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_modules.sh" "/ha_modules.sh"
RUN /ha_modules.sh "$MODULES" && rm /ha_modules.sh
# Manual apps
ENV PACKAGES="sudo nginx"