fix docker run file to use correct flags

This commit is contained in:
Hector 2022-01-31 22:37:38 +00:00
parent 1321aa92aa
commit 86d36221c2

View File

@ -7,14 +7,15 @@ socket_path=/var/run/fail2ban/fail2ban.sock
textfile_dir=/app/textfile/ textfile_dir=/app/textfile/
textfile_enabled=false textfile_enabled=false
# Enable textfile metrics if the folder exists (i.e. was mounted by docker)
if [ -d $textfile_dir ]; then
textfile_enabled=true
fi
# Start the exporter (use exec to support graceful shutdown) # Start the exporter (use exec to support graceful shutdown)
# Inspired by: https://akomljen.com/stopping-docker-containers-gracefully/ # Inspired by: https://akomljen.com/stopping-docker-containers-gracefully/
exec /app/fail2ban-prometheus-exporter \ # Enable textfile metrics if the folder exists (i.e. was mounted by docker)
if [ -d $textfile_dir ]; then
exec /app/fail2ban-prometheus-exporter \
--socket "$socket_path" \ --socket "$socket_path" \
--collector.textfile=$textfile_enabled \ --collector.textfile \
--collector.textfile.directory="$textfile_dir" --collector.textfile.directory "$textfile_dir"
else
exec /app/fail2ban-prometheus-exporter \
--socket "$socket_path"
fi