#!/bin/bash
#
#  Kerberize access to icinga and munin.
#

set -e


sed -i -e "s/AuthType Basic/AuthType Kerberos/" \
    -e "s#AuthUserFile .*#Krb5Keytab /etc/krb5.keytab.http#" ${target}/etc/icinga2-classicui/apache2.conf

sed -i -e "s/=icingaadmin/=*/" ${target}/etc/icinga2-classicui/cgi.cfg

sed -i -e "s/^[[:space:]]*Allow from localhost .*/	Allow from All/" \
    -e "s%\# AuthUserFile .*%Krb5Keytab /etc/krb5.keytab.http%" \
    -e "s/\# AuthType Basic/AuthType Kerberos/" \
    -e "s/\# require valid-user/Require valid-user/" ${target}/etc/munin/apache24.conf
