add new
This commit is contained in:
18
container-stats/root/etc/services.d/stats/run
Normal file
18
container-stats/root/etc/services.d/stats/run
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
set -e
|
||||
|
||||
bashio::log.info 'Start docker statistics'
|
||||
|
||||
if bashio::config.has_value 'update_interval'; then
|
||||
export STATS_UPDATE_INTERVAL=$(bashio::config 'update_interval')
|
||||
fi
|
||||
|
||||
if [ ! -d /container-stats/db ] && bashio::config 'persistent'; then
|
||||
[ ! -d /data/db ] && mkdir -p /data/db
|
||||
ln -s /data/db/ /container-stats/db
|
||||
else
|
||||
mkdir -p /container-stats/db
|
||||
fi
|
||||
|
||||
cd /container-stats
|
||||
node stats.js
|
||||
11
container-stats/root/etc/services.d/webserver/run
Normal file
11
container-stats/root/etc/services.d/webserver/run
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user