Make startup scripts robust (#37)

* Clean up file if exists and mkdir -p

* Make importing dashboards more robust

* Update info msgs
This commit is contained in:
Colin Seymour
2024-08-30 12:45:36 +01:00
committed by GitHub
parent d97377bc0e
commit 04e01df081
3 changed files with 30 additions and 19 deletions
+7 -1
View File
@@ -1,5 +1,11 @@
#!/command/with-contenv bashio
# -*- bash -*-
# shellcheck shell=bash
mkdir /run/nginx
bashio::log.info "Starting NGINX..."
if [ -f /run/nginx ]; then
rm -f /run/nginx
fi
mkdir -p /run/nginx
exec nginx -g 'daemon off;error_log /proc/1/fd/1 error;'
+2 -2
View File
@@ -54,7 +54,7 @@ done
# Import dashboards
if bashio::config.true 'grafana_import_dashboards'; then
/dashboards.sh restore
/dashboards.sh restore || bashio::log.error "Failed to import dashboards"
fi
# Create the PostgreSQL database if it doesn't exist
@@ -78,7 +78,7 @@ fi
ulimit -n 1048576
bashio::log.info "Starting TeslaMate"
bashio::log.info "Starting TeslaMate..."
cd /opt/app
exec $(/usr/bin/env sh) /entrypoint.sh bin/teslamate start