#!/usr/bin/with-contenv bashio
set -e

if [ ! -d /container-stats/db ]; then
	bashio::log.debug 'Wait for database'
	sleep 2s
fi

bashio::log.info 'Start webserver'
cd /container-stats
node httpd.js
