Fix database check and creation (#23)

* Refactor db check and create

* Make exit more accurate
This commit is contained in:
Colin Seymour
2024-07-18 16:20:36 +01:00
committed by GitHub
parent 213a2205fc
commit 64f0213e30
3 changed files with 27 additions and 19 deletions
+8 -2
View File
@@ -2,8 +2,14 @@
# -*- bash -*-
# shellcheck shell=bash
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
bashio::log.warning "TeslaMate crashed, halting add-on"
case "${1}" in
1)
bashio::log.error "TeslaMate encountered an error, halting add-on"
;;
*)
bashio::log.error "TeslaMate crashed, halting add-on"
;;
esac
/run/s6/basedir/bin/halt
fi
bashio::log.info "TeslaMate stopped, restarting..."