⬆️ Synced libraries and files with the current Alpine base

This commit is contained in:
Franck Nijhof 2017-12-13 00:07:20 +01:00
parent 1bec299eee
commit 777bcb0080
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
3 changed files with 23 additions and 1 deletions

View 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

View file

@ -15,4 +15,4 @@ if hass.api.supervisor.ping; then
echo " From: $(hass.addon.repository)"
echo " By: $(hass.addon.maintainer)"
echo '-----------------------------------------------------------'
fi
fi

View file

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