test
This commit is contained in:
38
addon-ubuntu-base/s6-overlay/etc/s6-rc/scripts/base-addon-banner
Executable file
38
addon-ubuntu-base/s6-overlay/etc/s6-rc/scripts/base-addon-banner
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Base Images
|
||||
# Displays a simple add-on banner on startup
|
||||
# ==============================================================================
|
||||
if bashio::supervisor.ping; then
|
||||
bashio::log.blue \
|
||||
'-----------------------------------------------------------'
|
||||
bashio::log.blue " Add-on: $(bashio::addon.name)"
|
||||
bashio::log.blue " $(bashio::addon.description)"
|
||||
bashio::log.blue \
|
||||
'-----------------------------------------------------------'
|
||||
|
||||
bashio::log.blue " Add-on version: $(bashio::addon.version)"
|
||||
if bashio::var.true "$(bashio::addon.update_available)"; then
|
||||
bashio::log.magenta ' There is an update available for this add-on!'
|
||||
bashio::log.magenta \
|
||||
" Latest add-on version: $(bashio::addon.version_latest)"
|
||||
bashio::log.magenta ' Please consider upgrading as soon as possible.'
|
||||
else
|
||||
bashio::log.green ' You are running the latest version of this add-on.'
|
||||
fi
|
||||
|
||||
bashio::log.blue " System: $(bashio::info.operating_system)" \
|
||||
" ($(bashio::info.arch) / $(bashio::info.machine))"
|
||||
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
|
||||
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
|
||||
|
||||
bashio::log.blue \
|
||||
'-----------------------------------------------------------'
|
||||
bashio::log.blue \
|
||||
' Please, share the above information when looking for help'
|
||||
bashio::log.blue \
|
||||
' or support in, e.g., GitHub, forums or the Discord chat.'
|
||||
bashio::log.blue \
|
||||
'-----------------------------------------------------------'
|
||||
fi
|
||||
49
addon-ubuntu-base/s6-overlay/etc/s6-rc/scripts/base-addon-log-level
Executable file
49
addon-ubuntu-base/s6-overlay/etc/s6-rc/scripts/base-addon-log-level
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Base Images
|
||||
# Sets the log level correctly
|
||||
# ==============================================================================
|
||||
declare log_level
|
||||
|
||||
# Check if the log level configuration option exists
|
||||
if bashio::config.exists log_level; then
|
||||
|
||||
# Find the matching LOG_LEVEL
|
||||
log_level=$(bashio::string.lower "$(bashio::config log_level)")
|
||||
case "${log_level}" in
|
||||
all)
|
||||
log_level="${__BASHIO_LOG_LEVEL_ALL}"
|
||||
;;
|
||||
trace)
|
||||
log_level="${__BASHIO_LOG_LEVEL_TRACE}"
|
||||
;;
|
||||
debug)
|
||||
log_level="${__BASHIO_LOG_LEVEL_DEBUG}"
|
||||
;;
|
||||
info)
|
||||
log_level="${__BASHIO_LOG_LEVEL_INFO}"
|
||||
;;
|
||||
notice)
|
||||
log_level="${__BASHIO_LOG_LEVEL_NOTICE}"
|
||||
;;
|
||||
warning)
|
||||
log_level="${__BASHIO_LOG_LEVEL_WARNING}"
|
||||
;;
|
||||
error)
|
||||
log_level="${__BASHIO_LOG_LEVEL_ERROR}"
|
||||
;;
|
||||
fatal)
|
||||
log_level="${__BASHIO_LOG_LEVEL_FATAL}"
|
||||
;;
|
||||
off)
|
||||
log_level="${__BASHIO_LOG_LEVEL_OFF}"
|
||||
;;
|
||||
*)
|
||||
bashio::exit.nok "Unknown log_level: ${log_level}"
|
||||
esac
|
||||
|
||||
# Save determined log level so S6 can pick it up later
|
||||
echo "${log_level}" > /var/run/s6/container_environment/LOG_LEVEL
|
||||
bashio::log.blue "Log level is set to ${__BASHIO_LOG_LEVELS[$log_level]}"
|
||||
fi
|
||||
12
addon-ubuntu-base/s6-overlay/etc/s6-rc/scripts/base-addon-timezone
Executable file
12
addon-ubuntu-base/s6-overlay/etc/s6-rc/scripts/base-addon-timezone
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Base Images
|
||||
# Configures the timezone
|
||||
# ==============================================================================
|
||||
|
||||
bashio::log.info "Configuring timezone (${TZ:-None})..."
|
||||
|
||||
ln --symbolic --no-dereference --force "/usr/share/zoneinfo/${TZ:-UTC}" /etc/localtime
|
||||
echo "${TZ:-UTC}" > /etc/timezone
|
||||
dpkg-reconfigure --frontend noninteractive tzdata 2> /dev/null
|
||||
Reference in New Issue
Block a user