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:
@@ -1,5 +1,12 @@
|
||||
#!/command/execlineb -S1
|
||||
if { s6-test ${1} -ne 0 }
|
||||
if { s6-test ${1} -ne 256 }
|
||||
#!/usr/bin/env bashio
|
||||
# ==============================================================================
|
||||
# Take down the S6 supervision tree when service fails
|
||||
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||
# ==============================================================================
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
|
||||
bashio::log.warning "Halt add-on"
|
||||
exec /run/s6/basedir/bin/halt
|
||||
fi
|
||||
|
||||
bashio::log.info "Service restart after closing"
|
@@ -11,19 +11,19 @@
|
||||
# Delay to keep logs messages from overlapping with s6 logs
|
||||
sleep .5
|
||||
|
||||
echo "-------------------------------------------------------"
|
||||
echo -n "ring-mqtt.js version: "
|
||||
echo $(cat package.json | grep version | cut -f4 -d'"')
|
||||
echo Node version $(node -v)
|
||||
echo NPM version $(npm -v)
|
||||
git --version
|
||||
echo "-------------------------------------------------------"
|
||||
bashio::log.info "-------------------------------------------------------"
|
||||
bashio::log.info -n "ring-mqtt.js version: "
|
||||
bashio::log.info $(cat package.json | grep version | cut -f4 -d'"')
|
||||
bashio::log.info Node version $(node -v)
|
||||
bashio::log.info NPM version $(npm -v)
|
||||
bashio::log.info $(git --version)
|
||||
bashio::log.info "-------------------------------------------------------"
|
||||
|
||||
# If HASSIO_TOKEN variable exist we are running as addon
|
||||
if [ -v HASSIO_TOKEN ]; then
|
||||
export RUNMODE="addon"
|
||||
if ! bashio::config.require 'mqtt_url_test'; then
|
||||
exit 2
|
||||
exit 256
|
||||
fi
|
||||
|
||||
if bashio::services.available 'mqtt'; then
|
||||
@@ -62,5 +62,5 @@ else
|
||||
cd /app/ring-mqtt
|
||||
fi
|
||||
|
||||
echo "Running ring-mqtt..."
|
||||
bashio::log.info "Running ring-mqtt..."
|
||||
exec ./ring-mqtt.js
|
||||
|
Reference in New Issue
Block a user