🚑 Fix directory creation (#15)

This commit is contained in:
Franck Nijhof 2021-08-19 01:18:48 +02:00 committed by GitHub
parent dc313a598b
commit 5a6801e158
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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