From 02315b4211ac0b91c1bf75f8d3cf6ab144798193 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 2 Aug 2022 15:11:01 +0200 Subject: [PATCH] Proposed code https://github.com/alexbelgium/hassio-addons/issues/411 --- .../rootfs/etc/cont-init.d/99-add_packages.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/nextcloud/rootfs/etc/cont-init.d/99-add_packages.sh b/nextcloud/rootfs/etc/cont-init.d/99-add_packages.sh index bfe319b63..1aaf2dcd8 100644 --- a/nextcloud/rootfs/etc/cont-init.d/99-add_packages.sh +++ b/nextcloud/rootfs/etc/cont-init.d/99-add_packages.sh @@ -15,16 +15,19 @@ fi if bashio::config.has_value 'additional_apps'; then bashio::log.info "Installing additional apps :" NEWAPPS="$(bashio::config 'additional_apps')" + OIFS=$IFS IFS="," re='^( *).*' read -ra array <<< "$NEWAPPS" + IFS=$OIFS for element in "${array[@]}" do - # shellcheck disable=SC2295 - APP="${element#${BASH_REMATCH[1]}}" - # shellcheck disable=SC2015 - [[ $element =~ $re ]] && \ - bashio::log.green "... $APP" && \ - apk add --no-cache "$APP" || bashio::log.red "... not successful, please check $APP package name" + if [[ $element =~ $re ]]; then + # shellcheck disable=SC2295 + APP="${element#${BASH_REMATCH[1]}}" + bashio::log.green "... $APP" + # shellcheck disable=SC2015 + apk add --no-cache $APP || bashio::log.red "... not successful, please check $APP package name" + fi done fi