mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-06 15:45:56 +02:00
Making script work with new HA
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# shellcheck disable=SC2015
|
|
||||||
# If dockerfile failed install manually
|
# If dockerfile failed install manually
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
@@ -13,10 +13,8 @@ if [ -e "/MODULESFILE" ]; then
|
|||||||
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 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 \
|
&& 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 \
|
||||||
&& mkdir -p /etc/cont-init.d \
|
&& 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" \
|
&& 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 \
|
||||||
&& [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] \
|
&& chmod -R 755 /etc/cont-init.d
|
||||||
&& echo "setting permission" && chmod 755 /etc/cont-init.d/"$scripts" || (echo "script failed to install $scripts" && exit 1); done
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
@@ -33,3 +31,13 @@ if [ -e "/ENVFILE" ]; then
|
|||||||
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
|
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
|
||||||
&& rm /automatic_packages.sh
|
&& rm /automatic_packages.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -e "/MODULESFILE" ] && [ ! -f /entrypoint.sh ]; then
|
||||||
|
for scripts in $MODULES; do
|
||||||
|
echo "$scripts : executing"
|
||||||
|
chown "$(id -u)":"$(id -g)" /etc/cont-init.d/"$scripts"
|
||||||
|
chmod a+x /etc/cont-init.d/"$scripts"
|
||||||
|
/./etc/cont-init.d/"$scripts" || echo "/etc/cont-init.d/$scripts: exiting $?"
|
||||||
|
rm /etc/cont-init.d/"$scripts"
|
||||||
|
done | tac
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user