mirror of
https://github.com/hassio-addons/addon-debian-base.git
synced 2025-05-07 12:41:31 +00:00
⬆️ Synced libraries and files with the current Alpine base
This commit is contained in:
parent
1bec299eee
commit
777bcb0080
3 changed files with 23 additions and 1 deletions
16
debian-base/rootfs/etc/cont-finish.d/99-message.sh
Normal file
16
debian-base/rootfs/etc/cont-finish.d/99-message.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Base Images
|
||||
# Displays an message right before terminating in case something went wrong
|
||||
# ==============================================================================
|
||||
|
||||
if [[ "${S6_STAGE2_EXITED}" -ne 0 ]]; then
|
||||
echo '-----------------------------------------------------------'
|
||||
echo ' Oops! Something went wrong.'
|
||||
echo ' '
|
||||
echo ' We are so sorry, but something went terribly wrong when'
|
||||
echo ' starting or running this add-on.'
|
||||
echo ' '
|
||||
echo ' Be sure to check the log above, line by line, for hints.'
|
||||
echo '-----------------------------------------------------------'
|
||||
fi
|
|
@ -15,4 +15,4 @@ if hass.api.supervisor.ping; then
|
|||
echo " From: $(hass.addon.repository)"
|
||||
echo " By: $(hass.addon.maintainer)"
|
||||
echo '-----------------------------------------------------------'
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -46,14 +46,20 @@ hass.api.call() {
|
|||
local resource=${2}
|
||||
local raw=${3:-false}
|
||||
local filter=${4:-}
|
||||
local auth_header='X-HASSIO-KEY;'
|
||||
local response
|
||||
local status
|
||||
local result
|
||||
|
||||
hass.log.trace "${FUNCNAME[0]}" "$@"
|
||||
|
||||
if [[ ! -z "${API_TOKEN:-}" ]]; then
|
||||
auth_header="X-HASSIO-KEY: ${API_TOKEN}"
|
||||
fi
|
||||
|
||||
if ! response=$(curl --silent --show-error \
|
||||
--write-out '\n%{http_code}' --request "${method}" \
|
||||
-H "${auth_header}" \
|
||||
"${HASS_API_ENDPOINT}${resource}"
|
||||
); then
|
||||
hass.log.debug "${response}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue