mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-30 16:37:40 +01:00
36 lines
1.3 KiB
Bash
36 lines
1.3 KiB
Bash
#!/usr/bin/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
|
|
# Uprade
|
|
echo "Updating distribution"
|
|
apt-get update &>/dev/null || apk update &>/dev/null || true
|
|
apt-get -y upgrade &>/dev/null || apk upgrade &>/dev/null || true
|
|
|
|
# Fix mate software center
|
|
if [ -f /usr/lib/dbus-1.0/dbus-daemon-launch-helper ]; then
|
|
echo "Allow software center"
|
|
chmod u+s /usr/lib/dbus-1.0/dbus-daemon-launch-helper
|
|
service dbus restart
|
|
fi
|
|
|
|
# Add repositories
|
|
{ echo "http://dl-cdn.alpinelinux.org/alpine/edge/community";
|
|
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing";
|
|
echo "http://dl-cdn.alpinelinux.org/alpine/edge/main";
|
|
echo "http://dl-cdn.alpinelinux.org/alpine/edge/releases";
|
|
echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/community";
|
|
echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/main";
|
|
echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/releases"; } > /etc/apk/repositories
|
|
|
|
# Install specific apps
|
|
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
|
|
bashio::log.green "... $APP"
|
|
apk add --no-cache "$APP" &>/dev/null || apt-get install -yqq "$APP" &>/dev/null \
|
|
&& bashio::log.green "... done" || bashio::log.red "... not successful, please check package name"
|
|
done
|
|
fi
|