mirror of
https://github.com/hassio-addons/addon-glances.git
synced 2025-05-04 19:11:23 +00:00
Fix influxdb2 configuration (#357)
This commit is contained in:
parent
2b3bca3e98
commit
15406b58e9
2 changed files with 12 additions and 5 deletions
|
@ -64,11 +64,11 @@ schema:
|
|||
enabled: bool
|
||||
host: str
|
||||
port: port
|
||||
username: str
|
||||
password: password
|
||||
database: str
|
||||
username: str?
|
||||
password: password?
|
||||
database: str?
|
||||
org: str?
|
||||
prefix: str
|
||||
prefix: str?
|
||||
interval: int
|
||||
ssl: bool?
|
||||
token: str?
|
||||
|
|
|
@ -26,6 +26,10 @@ if bashio::config.true 'influxdb.enabled'; then
|
|||
|
||||
# Modify the configuration
|
||||
if bashio::config.equals 'influxdb.version' '1'; then
|
||||
bashio::config.require "influxdb.username"
|
||||
bashio::config.require "influxdb.password"
|
||||
bashio::config.require "influxdb.database"
|
||||
bashio::config.require "influxdb.prefix"
|
||||
{
|
||||
echo "[influxdb]"
|
||||
echo "user=$(bashio::config 'influxdb.username')"
|
||||
|
@ -34,8 +38,11 @@ if bashio::config.true 'influxdb.enabled'; then
|
|||
echo "prefix=$(bashio::config 'influxdb.prefix')"
|
||||
} >> /etc/glances.conf
|
||||
elif bashio::config.equals 'influxdb.version' '2'; then
|
||||
bashio::config.require "influxdb.org"
|
||||
bashio::config.require "influxdb.bucket"
|
||||
bashio::config.require "influxdb.token"
|
||||
{
|
||||
echo "[influxdb 2]"
|
||||
echo "[influxdb2]"
|
||||
echo "org=$(bashio::config 'influxdb.org')"
|
||||
echo "bucket=$(bashio::config 'influxdb.bucket')"
|
||||
echo "token=$(bashio::config 'influxdb.token')"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue