From 5dc864b47f7f2bc06a341f301ba0b12f804cfdbe Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 11 Feb 2019 11:36:34 +0100 Subject: [PATCH] fixes invalid folder check -f check if a file exists. -d checks if the dir exists --- packaging/deb/control/postinst | 4 ++-- packaging/rpm/control/postinst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/deb/control/postinst b/packaging/deb/control/postinst index 93fa276854c..957f8aef307 100755 --- a/packaging/deb/control/postinst +++ b/packaging/deb/control/postinst @@ -31,13 +31,13 @@ case "$1" in cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml fi - if [ ! -f $PROVISIONING_CFG_DIR ]; then + if [ ! -d $PROVISIONING_CFG_DIR ]; then mkdir -p $PROVISIONING_CFG_DIR/dashboards $PROVISIONING_CFG_DIR/datasources cp /usr/share/grafana/conf/provisioning/dashboards/sample.yaml $PROVISIONING_CFG_DIR/dashboards/sample.yaml cp /usr/share/grafana/conf/provisioning/datasources/sample.yaml $PROVISIONING_CFG_DIR/datasources/sample.yaml fi - if [ ! -f $PROVISIONING_CFG_DIR/notifiers ]; then + if [ ! -d $PROVISIONING_CFG_DIR/notifiers ]; then mkdir -p $PROVISIONING_CFG_DIR/notifiers cp /usr/share/grafana/conf/provisioning/notifiers/sample.yaml $PROVISIONING_CFG_DIR/notifiers/sample.yaml fi diff --git a/packaging/rpm/control/postinst b/packaging/rpm/control/postinst index fe4429fd0d4..cd679838487 100755 --- a/packaging/rpm/control/postinst +++ b/packaging/rpm/control/postinst @@ -45,13 +45,13 @@ if [ $1 -eq 1 ] ; then cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml fi - if [ ! -f $PROVISIONING_CFG_DIR ]; then + if [ ! -d $PROVISIONING_CFG_DIR ]; then mkdir -p $PROVISIONING_CFG_DIR/dashboards $PROVISIONING_CFG_DIR/datasources cp /usr/share/grafana/conf/provisioning/dashboards/sample.yaml $PROVISIONING_CFG_DIR/dashboards/sample.yaml cp /usr/share/grafana/conf/provisioning/datasources/sample.yaml $PROVISIONING_CFG_DIR/datasources/sample.yaml fi - if [ ! -f $PROVISIONING_CFG_DIR/notifiers ]; then + if [ ! -d $PROVISIONING_CFG_DIR/notifiers ]; then mkdir -p $PROVISIONING_CFG_DIR/notifiers cp /usr/share/grafana/conf/provisioning/notifiers/sample.yaml $PROVISIONING_CFG_DIR/notifiers/sample.yaml fi