diff --git a/.templates/00-banner.sh b/.templates/00-banner.sh index 0ad71a712..a4372f5d5 100755 --- a/.templates/00-banner.sh +++ b/.templates/00-banner.sh @@ -4,7 +4,7 @@ set -e # ============================================================================== # Displays a simple add-on banner on startup # ============================================================================== -if bashio::supervisor.ping; then +if bashio::supervisor.ping 2>/dev/null; then bashio::log.blue \ '-----------------------------------------------------------' bashio::log.blue " Add-on: $(bashio::addon.name)" @@ -39,23 +39,30 @@ if bashio::supervisor.ping; then ' Provided by: https://github.com/alexbelgium/hassio-addons ' bashio::log.blue \ '-----------------------------------------------------------' -fi -# ============================================================================== -# Global actions for all addons -# ============================================================================== -if bashio::config.has_value "PUID" && bashio::config.has_value "PGID"; then - bashio::log.green \ - ' Defining permissions for main user : ' - PUID="$(bashio::config "PUID")" - PGID="$(bashio::config "PGID")" - bashio::log.blue "User UID: $PUID" - bashio::log.blue "User GID : $PGID" - id -u abc &>/dev/null || usermod -o -u "$PUID" abc &>/dev/null || true - id -g abc &>/dev/null || groupmod -o -g "$PGID" abc &>/dev/null || true + # ============================================================================== + # Global actions for all addons + # ============================================================================== + if bashio::config.has_value "PUID" && bashio::config.has_value "PGID"; then + bashio::log.green \ + ' Defining permissions for main user : ' + PUID="$(bashio::config "PUID")" + PGID="$(bashio::config "PGID")" + bashio::log.blue "User UID: $PUID" + bashio::log.blue "User GID : $PGID" + id -u abc &>/dev/null || usermod -o -u "$PUID" abc &>/dev/null || true + id -g abc &>/dev/null || groupmod -o -g "$PGID" abc &>/dev/null || true + bashio::log.blue \ + '-----------------------------------------------------------' + fi + + # Clean bashrc file + if [ -f ~/.bashrc ]; then rm ~/.bashrc; fi + +else + bashio::log.blue \ + '-----------------------------------------------------------' + bashio::log.blue " Starting addon without HA support" bashio::log.blue \ '-----------------------------------------------------------' fi - -# Clean bashrc file -if [ -f ~/.bashrc ]; then rm ~/.bashrc; fi