# Handle the incoming configuration files: config() { NEW="$1" OLD="`dirname $NEW`/`basename $NEW .new`" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } # Check for munin account here if ! grep ^munin: /etc/group 2>&1 > /dev/null; then groupadd -g 301 munin fi if ! grep ^munin: /etc/passwd 2>&1 > /dev/null; then useradd -d /var/lib/munin -s /bin/bash -u 301 -g 301 -c "Munin" munin fi # Display cron command echo "See the example cron entry (for the munin user) for further setup: /etc/munin/munin-cron-entry" # Ensure directories exist mkdir -p /var/{lib,log}/munin /var/run/munin # Fix permissions on necessary directories chown munin.munin -R /var/{lib,log}/munin /var/run/munin #fc-cache -fs config etc/munin/munin.conf.new