Commit 50bc801f by bergquist

dashboards as cfg: copy dash/ds files if missing

parent 361acd3f
...@@ -29,11 +29,13 @@ case "$1" in ...@@ -29,11 +29,13 @@ case "$1" in
if [ ! -f $CONF_FILE ]; then if [ ! -f $CONF_FILE ]; then
cp /usr/share/grafana/conf/sample.ini $CONF_FILE cp /usr/share/grafana/conf/sample.ini $CONF_FILE
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
fi
if [ ! -f $DATASOURCES_CFG_DIR ]; then
mkdir -p /etc/grafana/dashboards /etc/grafana/datasources mkdir -p /etc/grafana/dashboards /etc/grafana/datasources
cp /usr/share/grafana/conf/dashboards/sample.yaml /etc/grafana/dashboards/sample.yaml cp /usr/share/grafana/conf/dashboards/sample.yaml $DASHBOARDS_CFG_DIR/sample.yaml
cp /usr/share/grafana/conf/datasources/sample.yaml /etc/grafana/datasources/sample.yaml cp /usr/share/grafana/conf/datasources/sample.yaml $DATASOURCES_CFG_DIR/sample.yaml
fi fi
# configuration files should not be modifiable by grafana user, as this can be a security issue # configuration files should not be modifiable by grafana user, as this can be a security issue
chown -Rh root:$GRAFANA_GROUP /etc/grafana/* chown -Rh root:$GRAFANA_GROUP /etc/grafana/*
......
...@@ -43,11 +43,13 @@ if [ $1 -eq 1 ] ; then ...@@ -43,11 +43,13 @@ if [ $1 -eq 1 ] ; then
if [ ! -f $CONF_FILE ]; then if [ ! -f $CONF_FILE ]; then
cp /usr/share/grafana/conf/sample.ini $CONF_FILE cp /usr/share/grafana/conf/sample.ini $CONF_FILE
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
fi
if [ ! -f $DATASOURCES_CFG_DIR ]; then
mkdir -p /etc/grafana/dashboards /etc/grafana/datasources mkdir -p /etc/grafana/dashboards /etc/grafana/datasources
cp /usr/share/grafana/conf/dashboards/sample.yaml /etc/grafana/dashboards/sample.yaml cp /usr/share/grafana/conf/dashboards/sample.yaml $DASHBOARDS_CFG_DIR/sample.yaml
cp /usr/share/grafana/conf/datasources/sample.yaml /etc/grafana/datasources/sample.yaml cp /usr/share/grafana/conf/datasources/sample.yaml $DATASOURCES_CFG_DIR/sample.yaml
fi fi
# Set user permissions on /var/log/grafana, /var/lib/grafana # Set user permissions on /var/log/grafana, /var/lib/grafana
mkdir -p /var/log/grafana /var/lib/grafana mkdir -p /var/log/grafana /var/lib/grafana
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment