mirror of
https://github.com/tsightler/ring-mqtt.git
synced 2025-09-26 21:01:12 +08:00
Update init scripts
This commit is contained in:
@@ -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 |"
|
||||
|
@@ -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..."
|
Reference in New Issue
Block a user