Skip to content

Commit 080592b

Browse files
committed
Fix finish script for rtl_tcp
1 parent 3f2a7fd commit 080592b

File tree

1 file changed

+10
-4
lines changed
  • amr2mqtt/rootfs/etc/services.d/rtl_tcp

1 file changed

+10
-4
lines changed
+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
#!/usr/bin/execlineb -S0
1+
#!/usr/bin/env bashio
22
# ==============================================================================
33
# Home Assistant Add-on: AMR2MQTT
44
# Take down the S6 supervision tree when AMR2MQTT fails
55
# ==============================================================================
6-
if { s6-test ${1} -ne 0 }
7-
if { s6-test ${1} -ne 256 }
86

9-
s6-svscanctl -t /var/run/s6/service
7+
declare APP_EXIT_CODE=${1}
8+
9+
if [[ "${APP_EXIT_CODE}" -ne 0 ]] && [[ "${APP_EXIT_CODE}" -ne 256 ]]; then
10+
bashio::log.warning "Halt add-on with exit code ${APP_EXIT_CODE}"
11+
echo "${APP_EXIT_CODE}" > /run/s6-linux-init-container-results/exitcode
12+
exec /run/s6/basedir/bin/halt
13+
fi
14+
15+
bashio::log.info "Service restart after closing"

0 commit comments

Comments
 (0)