mirror of
https://github.com/hassio-addons/addon-glances.git
synced 2025-05-04 19:11:23 +00:00
28 lines
648 B
Text
28 lines
648 B
Text
#!/usr/bin/with-contenv bash
|
|
# ==============================================================================
|
|
# Community Hass.io Add-ons: Glances
|
|
# Runs Glances InfluxDB Export
|
|
# ==============================================================================
|
|
# shellcheck disable=SC1091
|
|
source /usr/lib/hassio-addons/base.sh
|
|
|
|
declare -a options
|
|
|
|
if hass.config.false 'influxdb.enabled'; then
|
|
exec sleep 86400
|
|
fi
|
|
|
|
options+=(-C /etc/glances.conf)
|
|
options+=(--export influxdb)
|
|
options+=(--quiet)
|
|
|
|
if hass.debug; then
|
|
options+=(--debug)
|
|
fi
|
|
|
|
# Interval
|
|
sleep "$(hass.config.get 'influxdb.interval')"
|
|
|
|
# Run Glances
|
|
exec glances "${options[@]}"
|
|
|