File tree 1 file changed +10
-4
lines changed
amr2mqtt/rootfs/etc/services.d/rtl_tcp
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
- #!/usr/bin/execlineb -S0
1
+ #!/usr/bin/env bashio
2
2
# ==============================================================================
3
3
# Home Assistant Add-on: AMR2MQTT
4
4
# Take down the S6 supervision tree when AMR2MQTT fails
5
5
# ==============================================================================
6
- if { s6-test ${1} -ne 0 }
7
- if { s6-test ${1} -ne 256 }
8
6
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"
You can’t perform that action at this time.
0 commit comments