ff
Some checks failed
ci/woodpecker/push/gitleaks Pipeline was successful
ci/woodpecker/pr/gitleaks Pipeline was successful
ci/woodpecker/push/ansible-lint Pipeline failed
ci/woodpecker/pr/ansible-lint Pipeline failed

This commit is contained in:
Michael Grote 2024-08-12 13:16:19 +02:00
parent 42ede01c42
commit 945d883cb6

View file

@ -55,31 +55,33 @@
# TODO mail config? wie senden? # TODO mail config? wie senden?
# COPY munin_mail.conf /etc/munin/munin-conf.d/munin_mail.conf # COPY munin_mail.conf /etc/munin/munin-conf.d/munin_mail.conf
# configure mail notification
if [[ -n "$MAILCONTACT" && -n "$MAILSERVER" && -n "$MAILPORT" && -n "$MAILUSER" && -n "$MAILPASSWORD" && -n "$MAILDOMAIN" ]] ; then
MAILCONTACT=${MAILCONTACT:="contact@domain.test"} # # configure mail notification
sed -i "s/mailcontact/$MAILCONTACT/g" /etc/ssmtp/ssmtp.conf # if [[ -n "$MAILCONTACT" && -n "$MAILSERVER" && -n "$MAILPORT" && -n "$MAILUSER" && -n "$MAILPASSWORD" && -n "$MAILDOMAIN" ]] ; then
sed -i "s/mailcontact/$MAILCONTACT/g" /etc/munin/munin-conf.d/munin_mail.conf # MAILCONTACT=${MAILCONTACT:="contact@domain.test"}
MAILSERVER=${MAILSERVER:="mail.domain.test"} # sed -i "s/mailcontact/$MAILCONTACT/g" /etc/ssmtp/ssmtp.conf
sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/ssmtp.conf # sed -i "s/mailcontact/$MAILCONTACT/g" /etc/munin/munin-conf.d/munin_mail.conf
sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/revaliases # MAILSERVER=${MAILSERVER:="mail.domain.test"}
MAILPORT=${MAILPORT:="25"} # sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/ssmtp.conf
sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/ssmtp.conf # sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/revaliases
sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/revaliases # MAILPORT=${MAILPORT:="25"}
MAILUSER=${MAILUSER:="alert@domain.test"} # sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/ssmtp.conf
sed -i "s/mailuser/$MAILUSER/g" /etc/ssmtp/ssmtp.conf # sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/revaliases
MAILFROM=${MAILFROM:="munin@domain.test"} # MAILUSER=${MAILUSER:="alert@domain.test"}
sed -i "s/mailfrom/$MAILFROM/g" /etc/ssmtp/revaliases # sed -i "s/mailuser/$MAILUSER/g" /etc/ssmtp/ssmtp.conf
MAILPASSWORD=${MAILPASSWORD:="XXXXXXXXX"} # MAILFROM=${MAILFROM:="munin@domain.test"}
sed -i "s/mailpassword/$MAILPASSWORD/g" /etc/ssmtp/ssmtp.conf # sed -i "s/mailfrom/$MAILFROM/g" /etc/ssmtp/revaliases
MAILDOMAIN=${MAILDOMAIN:="domain.test"} # MAILPASSWORD=${MAILPASSWORD:="XXXXXXXXX"}
sed -i "s/maildomain/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf # sed -i "s/mailpassword/$MAILPASSWORD/g" /etc/ssmtp/ssmtp.conf
sed -i "s/mailhost/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf # MAILDOMAIN=${MAILDOMAIN:="domain.test"}
MAILNAME=${MAILNAME:="Munin"} # sed -i "s/maildomain/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf
sed -i "s/munin application user/$MAILNAME/g" /etc/passwd # sed -i "s/mailhost/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf
else # MAILNAME=${MAILNAME:="Munin"}
rm /etc/munin/munin-conf.d/munin_mail.conf /etc/ssmtp/ssmtp.conf # sed -i "s/munin application user/$MAILNAME/g" /etc/passwd
fi # else
# rm /etc/munin/munin-conf.d/munin_mail.conf /etc/ssmtp/ssmtp.conf
# fi
# cronjoib? timer? TODO # cronjoib? timer? TODO