mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 21:19:16 -04:00
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:
+7
-1
@@ -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;'
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user