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]}"