From 7ce18ec4f79c529316fcb8d101e2aa2fa22be5b9 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 11 Feb 2019 11:30:41 +0100 Subject: [PATCH] extract notifiers folder creation to new if statement --- packaging/deb/control/postinst | 7 ++++--- packaging/rpm/control/postinst | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packaging/deb/control/postinst b/packaging/deb/control/postinst index 049061ac2dd..93fa276854c 100755 --- a/packaging/deb/control/postinst +++ b/packaging/deb/control/postinst @@ -32,11 +32,12 @@ case "$1" in fi if [ ! -f $PROVISIONING_CFG_DIR ]; then - mkdir -p $PROVISIONING_CFG_DIR/dashboards $PROVISIONING_CFG_DIR/datasources $PROVISIONING_CFG_DIR/notifiers + 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 - cp /usr/share/grafana/conf/provisioning/notifiers/sample.yaml $PROVISIONING_CFG_DIR/notifiers/sample.yaml - elif [ ! -f $PROVISIONING_CFG_DIR/notifiers ]; then + fi + + if [ ! -f $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 0187fc82cc5..fe4429fd0d4 100755 --- a/packaging/rpm/control/postinst +++ b/packaging/rpm/control/postinst @@ -46,11 +46,12 @@ if [ $1 -eq 1 ] ; then fi if [ ! -f $PROVISIONING_CFG_DIR ]; then - mkdir -p $PROVISIONING_CFG_DIR/dashboards $PROVISIONING_CFG_DIR/datasources $PROVISIONING_CFG_DIR/notifiers + 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 - cp /usr/share/grafana/conf/provisioning/notifiers/sample.yaml $PROVISIONING_CFG_DIR/notifiers/sample.yaml - elif [ ! -f $PROVISIONING_CFG_DIR/notifiers ]; then + fi + + if [ ! -f $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