Update init scripts

This commit is contained in:
tsightler
2022-10-10 22:05:52 -04:00
parent 0f9b7fff56
commit 0fca37f730
2 changed files with 7 additions and 13 deletions

View File

@@ -10,11 +10,11 @@
# If HASSIO_TOKEN variable exist we are running as addon
if [ -v HASSIO_TOKEN ]; then
RUNMODE_BANNER_DESCRIPTION="Addon for Home Assistant "
RUNMODE_BANNER="Addon for Home Assistant "
# Use bashio to get configured branch
export BRANCH=$(bashio::config "branch")
else
RUNMODE_BANNER_DESCRIPTION="Docker Edition "
RUNMODE_BANNER="Docker Edition "
fi
# Short delay to keep log messages from overlapping with s6 logs
@@ -22,7 +22,7 @@ sleep .5
echo "-------------------------------------------------------"
echo "| Ring-MQTT with Video Streaming |"
echo "| ${RUNMODE_BANNER_DESCRIPTION} |"
echo "| ${RUNMODE_BANNER} |"
echo "| |"
echo "| For support questions please visit: |"
echo "| https://github.com/tsightler/ring-mqtt/discussions |"

View File

@@ -4,15 +4,9 @@
# s6-overlay docs: https://github.com/just-containers/s6-overlay
# ==============================================================================
if test "$1" -eq 256 ; then
e=$((128 + $2))
else
e="$1"
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
bashio::log.warning "The ring-mqtt service crashed, halting add-on..."
/run/s6/basedir/bin/halt
fi
echo "$e" > /run/s6-linux-init-container-results/exitcode
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "A critical error was detected, exiting the container..."
exec /run/s6/basedir/bin/halt
fi
bashio::log.info "The ring-mqtt service exited unexpectedly, restarting..."