Subject: [PATCH] testing/blackbox_exporter: do not create user if already exist

From: Roshless <[email-masked]>
Date: Sun, 25 Jul 2021 23:50:47 +0200

---
 testing/blackbox_exporter/blackbox_exporter.pre-install | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testing/blackbox_exporter/blackbox_exporter.pre-install b/testing/blackbox_exporter/blackbox_exporter.pre-install
index eeccb43ce2..004fd0bcb9 100644
--- a/testing/blackbox_exporter/blackbox_exporter.pre-install
+++ b/testing/blackbox_exporter/blackbox_exporter.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
-addgroup -S prometheus 2>/dev/null
-adduser -SDh/var/lib/prometheus \
+grep '^prometheus:' /etc/group >/dev/null || addgroup -S prometheus 2>/dev/null
+grep '^prometheus:' /etc/passwd >/dev/null || adduser -SDh/var/lib/prometheus \
 	-s/sbin/nologin -Gprometheus -gprometheus prometheus prometheus 2>/dev/null
-- 
2.32.0