mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-16 22:01:48 +02:00
Beautify bash
This commit is contained in:
@@ -11,10 +11,10 @@ if [ -e "/MODULESFILE" ]; then
|
||||
echo "Executing modules script : $MODULES"
|
||||
|
||||
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 \
|
||||
&& 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
|
||||
&& 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 \
|
||||
&& 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
|
||||
fi
|
||||
|
||||
#######################
|
||||
@@ -25,9 +25,9 @@ if [ -e "/ENVFILE" ]; then
|
||||
echo "Executing dependency script with custom elements : $PACKAGES"
|
||||
|
||||
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 \
|
||||
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
|
||||
&& chmod 777 /automatic_packages.sh \
|
||||
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
|
||||
&& rm /automatic_packages.sh
|
||||
&& 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 \
|
||||
&& curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/automatic_packages.sh" --output /automatic_packages.sh \
|
||||
&& chmod 777 /automatic_packages.sh \
|
||||
&& eval /./automatic_packages.sh "${PACKAGES:-}" \
|
||||
&& rm /automatic_packages.sh
|
||||
fi
|
||||
|
||||
@@ -5,15 +5,15 @@ slug=paperless
|
||||
|
||||
if [ ! -d /config/addons_config/$slug ]; then
|
||||
|
||||
if [ -d /config/$slug ]; then
|
||||
echo "Moving to new location /config/addons_config/$slug"
|
||||
if [ -d /config/$slug ]; then
|
||||
echo "Moving to new location /config/addons_config/$slug"
|
||||
mkdir -p /config/addons_config/$slug
|
||||
chmod 777 /config/addons_config/$slug
|
||||
mv /config/$slug/* /config/addons_config/$slug/
|
||||
rm -r /config/$slug
|
||||
fi
|
||||
|
||||
echo "Creating /config/addons_config/$slug"
|
||||
mkdir -p /config/addons_config/$slug
|
||||
chmod 777 /config/addons_config/$slug
|
||||
mv /config/$slug/* /config/addons_config/$slug/
|
||||
rm -r /config/$slug
|
||||
fi
|
||||
|
||||
echo "Creating /config/addons_config/$slug"
|
||||
mkdir -p /config/addons_config/$slug
|
||||
chmod 777 /config/addons_config/$slug
|
||||
fi
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
OCRLANG=$(bashio::config 'OCRLANG')
|
||||
if [ -n "$OCRLANG" ]; then
|
||||
apt-get update &>/dev/null
|
||||
echo "OCRLANG variable is set, processing the language packages"
|
||||
for i in ${OCRLANG//,/ }; do
|
||||
if apt-cache show tesseract-ocr-"${i}" >/dev/null 2>&1; then
|
||||
apt-get install -yq tesseract-ocr-"${i}"
|
||||
bashio::log.info "OCR Language installed : $i" || bashio::log.fatal "Couldn't install OCR lang $i. Please check its format is conform"
|
||||
else
|
||||
echo "package tesseract-ocr-${i} not found in the repository, skipping"
|
||||
fi
|
||||
done
|
||||
apt-get update &>/dev/null
|
||||
echo "OCRLANG variable is set, processing the language packages"
|
||||
for i in ${OCRLANG//,/ }; do
|
||||
if apt-cache show tesseract-ocr-"${i}" >/dev/null 2>&1; then
|
||||
apt-get install -yq tesseract-ocr-"${i}"
|
||||
bashio::log.info "OCR Language installed : $i" || bashio::log.fatal "Couldn't install OCR lang $i. Please check its format is conform"
|
||||
else
|
||||
echo "package tesseract-ocr-${i} not found in the repository, skipping"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user