mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-05 15:57:23 +01:00
more work on munin
* install the munin-node package * don't install munin-plugins-extra (if the user wants it they can add it) * expose the munin www directory via the management daemon so that it can handle authorization, rather than manintaining a separate password file
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Grant admins access to munin
|
||||
|
||||
source setup/functions.sh # load our functions
|
||||
source /etc/mailinabox.conf # load global vars
|
||||
|
||||
db=$STORAGE_ROOT'/mail/users.sqlite'
|
||||
|
||||
users=`sqlite3 $db "SELECT email FROM users WHERE privileges = 'admin'"`;
|
||||
passwords=`sqlite3 $db "SELECT password FROM users WHERE privileges = 'admin'"`;
|
||||
|
||||
# Define the arrays
|
||||
users_array=(${users// / })
|
||||
passwords_array=(${passwords// / })
|
||||
|
||||
# clear htpasswd
|
||||
>/etc/nginx/htpasswd
|
||||
|
||||
# write user:password
|
||||
for i in "${!users_array[@]}"; do
|
||||
echo "${users_array[i]}:${passwords_array[i]:14}" >> /etc/nginx/htpasswd
|
||||
done
|
||||
Reference in New Issue
Block a user