custom apps code

This commit is contained in:
Alexandre
2023-09-02 17:11:00 +02:00
committed by GitHub
parent 2144c06fcf
commit b0f14e2337
2 changed files with 14 additions and 8 deletions

View File

@@ -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
}

View File

@@ -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