From b0f14e233772e37fc9c861388d01b4b891bff523 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 2 Sep 2023 17:11:00 +0200 Subject: [PATCH] custom apps code --- webtop_kde/config.json | 2 +- .../etc/cont-init.d/80-configuration.sh | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/webtop_kde/config.json b/webtop_kde/config.json index ee629cdba..c8f588fb3 100644 --- a/webtop_kde/config.json +++ b/webtop_kde/config.json @@ -117,6 +117,6 @@ }, "slug": "webtop-kde", "url": "https://github.com/alexbelgium/hassio-addons", - "version": "4.16-r0-ls89-test11", + "version": "4.16-r0-ls89-test12", "video": true } \ No newline at end of file diff --git a/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh b/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh index 76ec82c2b..29e611a0c 100755 --- a/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh +++ b/webtop_kde/rootfs/etc/cont-init.d/80-configuration.sh @@ -9,10 +9,15 @@ if bashio::config.has_value 'additional_apps'; then bashio::log.info "Installing additional apps :" # hadolint ignore=SC2005 NEWAPPS=$(bashio::config 'additional_apps') - for APP in ${NEWAPPS//,/ }; do + for packagestoinstall in ${NEWAPPS//,/ }; do bashio::log.green "... $APP" - # shellcheck disable=SC2015 - apk add --no-cache "$APP" >/dev/null || bashio::log.red "... not successful, please check package name" + if [ "$PACKMANAGER" = "apk" ]; then + apk add --no-cache "$packagestoinstall" &>/dev/null || (bashio::log.fatal "Error : $packagestoinstall not found") + elif [ "$PACKMANAGER" = "apt" ]; then + apt-get install -yqq --no-install-recommends "$packagestoinstall" &>/dev/null || (bashio::log.fatal "Error : $packagestoinstall not found") + elif [ "$PACKMANAGER" = "pacman" ]; then + pacman --noconfirm -S "$packagestoinstall" &>/dev/null || (bashio::log.fatal "Error : $packagestoinstall not found") + fi done fi @@ -20,8 +25,9 @@ fi if bashio::config.has_value 'TZ'; then TIMEZONE=$(bashio::config 'TZ') bashio::log.info "Setting timezone to $TIMEZONE" - ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime && echo "$TIMEZONE" >/etc/timezone -fi + ln -snf /usr/share/zoneinfo/"$TIMEZONE" /etc/localtime + echo "$TIMEZONE" >/etc/timezone +fi || true # Set keyboard if bashio::config.has_value 'KEYBOARD'; then @@ -30,7 +36,7 @@ if bashio::config.has_value 'KEYBOARD'; then sed -i "1a export KEYBOARD=$KEYBOARD" /etc/s6-overlay/s6-rc.d/svc-web/run if [ -d /var/run/s6/container_environment ]; then printf "%s" "$KEYBOARD" > /var/run/s6/container_environment/KEYBOARD; fi printf "%s" "KEYBOARD=\"$KEYBOARD\"" >> ~/.bashrc -fi +fi || true # Set password if bashio::config.has_value 'PASSWORD'; then @@ -38,4 +44,4 @@ if bashio::config.has_value 'PASSWORD'; then PASSWORD=$(bashio::config 'PASSWORD') passwd -d abc echo -e "$PASSWORD\n$PASSWORD" | passwd abc -fi +fi || true