mostly start using prometheus
[distro-setup] / conflink
index 90debe6b171cf265649c79cce60b70cfdfc88f04..bfd4e448814e38414c9f0ced5fdedcbfbf7256e4 100755 (executable)
--- a/conflink
+++ b/conflink
@@ -166,15 +166,24 @@ case $user in
     if [[ -e /var/lib/znc ]] && getent group znc; then
       s chown -R znc:znc /var/lib/znc
     fi
-    f=/etc/prometheus-htpasswd
+    for f in /etc/prometheus-{,export-}htpasswd; do
+      if [[ -e $f ]]; then
+        s chmod 640 $f
+        if getent passwd www-data; then
+          s chown root:www-data $f
+        fi
+      fi
+    done
+    f=/etc/prometheus-pass
     if [[ -e $f ]]; then
+      # note: this is duplicative of the file's own permissions
       s chmod 640 $f /etc/prometheus-pass
-      s chown root:www-data $f
       if getent passwd prometheus; then
-        s chown root:prometheus /etc/prometheus-pass
+        s chown root:prometheus $f
       fi
     fi
 
+
     ##### end special extra stuff #####
 
     m sudo -H -u user2 "${BASH_SOURCE[0]}"