#!/bin/bash NODES=${NODES:-} MUNIN_USER=${MUNIN_USER:-user} MUNIN_PASSWORD=${MUNIN_PASSWORD:-password} htpasswd -b -c /etc/munin/htpasswd.users "$MUNIN_USER" "$MUNIN_PASSWORD" # generate node list for NODE in $NODES do NAME=`echo $NODE | cut -d ":" -f1` HOST=`echo $NODE | cut -d ":" -f2` cat << EOF >> /etc/munin/munin.conf [$NAME] address $HOST use_node_name yes EOF done # placeholder html to prevent permission error if [ ! -e /var/cache/munin/www/index.html ]; then cat << EOF > /var/cache/munin/www/index.html