🚑 Fix directory creation

This commit is contained in:
Franck Nijhof 2021-08-19 01:13:31 +02:00
parent dc313a598b
commit 3348a661c1
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
bashio::log.info 'Starting prometheus config generator...' 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 mkdir -p /share/prometheus/targets
chown -R prometheus:prometheus /share/prometheus/targets chown -R prometheus:prometheus /share/prometheus/targets
fi fi

View file

@ -26,17 +26,17 @@ for var in $(bashio::config 'env_vars|keys'); do
export "${name}=${value}" export "${name}=${value}"
done done
if [[ ! -d /data/prometheus ]] ; then if ! bashio::fs.directory_exists /data/prometheus; then
mkdir -p /data/prometheus mkdir -p /data/prometheus
chown prometheus:prometheus /data/prometheus chown prometheus:prometheus /data/prometheus
fi fi
if [[ ! -d /share/promethus/rules ]] ; then if ! bashio::fs.directory_exists /share/prometheus/rules; then
mkdir -p /share/prometheus/rules mkdir -p /share/prometheus/rules
chown -R prometheus:prometheus /share/prometheus/rules chown -R prometheus:prometheus /share/prometheus/rules
fi fi
if [[ ! -d /share/promethus/targets ]] ; then if ! bashio::fs.directory_exists /share/prometheus/targets; then
mkdir -p /share/prometheus/targets mkdir -p /share/prometheus/targets
chown -R prometheus:prometheus /share/prometheus/targets chown -R prometheus:prometheus /share/prometheus/targets
fi fi