From 3348a661c1d231774fbc58aa9c4d8673605e9131 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 19 Aug 2021 01:13:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20Fix=20directory=20creation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prometheus/rootfs/etc/services.d/prometheus-configgen/run | 2 +- prometheus/rootfs/etc/services.d/prometheus/run | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/prometheus/rootfs/etc/services.d/prometheus-configgen/run b/prometheus/rootfs/etc/services.d/prometheus-configgen/run index 2016867..7219eff 100755 --- a/prometheus/rootfs/etc/services.d/prometheus-configgen/run +++ b/prometheus/rootfs/etc/services.d/prometheus-configgen/run @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio bashio::log.info 'Starting prometheus config generator...' -if [[ ! -d /share/promethus/targets ]] ; then +if ! bashio::fs.directory_exists /share/prometheus/targets; then mkdir -p /share/prometheus/targets chown -R prometheus:prometheus /share/prometheus/targets fi diff --git a/prometheus/rootfs/etc/services.d/prometheus/run b/prometheus/rootfs/etc/services.d/prometheus/run index 99dbd50..deb569a 100755 --- a/prometheus/rootfs/etc/services.d/prometheus/run +++ b/prometheus/rootfs/etc/services.d/prometheus/run @@ -26,17 +26,17 @@ for var in $(bashio::config 'env_vars|keys'); do export "${name}=${value}" done -if [[ ! -d /data/prometheus ]] ; then +if ! bashio::fs.directory_exists /data/prometheus; then mkdir -p /data/prometheus chown prometheus:prometheus /data/prometheus fi -if [[ ! -d /share/promethus/rules ]] ; then +if ! bashio::fs.directory_exists /share/prometheus/rules; then mkdir -p /share/prometheus/rules chown -R prometheus:prometheus /share/prometheus/rules fi -if [[ ! -d /share/promethus/targets ]] ; then +if ! bashio::fs.directory_exists /share/prometheus/targets; then mkdir -p /share/prometheus/targets chown -R prometheus:prometheus /share/prometheus/targets fi