45 lines
1.0 KiB
Bash
45 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
CFG="/etc/pve/notifications.cfg"
|
|
BACKUP="/etc/pve/notifications.cfg.bak.$(date +%Y%m%d%H%M%S)"
|
|
|
|
cp "$CFG" "$BACKUP"
|
|
echo "Backup angelegt: $BACKUP"
|
|
|
|
read -rp "Author (z.B. MH-PVE02 | MAIERHOME H33): " AUTHOR
|
|
read -rp "From-Address (z.B. MH-PVE02@vmd55888.de): " FROMADDR
|
|
read -rp "SMTP Server (z.B. mail.vmd55888.de): " SERVER
|
|
read -rp "SMTP Port (z.B. 587): " PORT
|
|
read -rp "Mode (starttls/ssl/none): " MODE
|
|
read -rp "Username: " USERNAME
|
|
read -rp "Mailto Adresse: " MAILTO
|
|
|
|
cat > "$CFG" <<EOF
|
|
sendmail: mail-to-root
|
|
comment Send mails to root@pam's email address
|
|
disable false
|
|
mailto-user root@pam
|
|
|
|
smtp: mailout
|
|
author $AUTHOR
|
|
from-address $FROMADDR
|
|
mailto $MAILTO
|
|
mailto-user root@pam
|
|
mode $MODE
|
|
port $PORT
|
|
server $SERVER
|
|
username $USERNAME
|
|
|
|
matcher: default-matcher
|
|
comment Route all notifications to mail-to-root
|
|
mode all
|
|
target mail-to-root
|
|
|
|
policy: default
|
|
sender mailout
|
|
targets mail-to-root
|
|
EOF
|
|
|
|
echo "Config geschrieben. Bitte Passwort manuell in der WebUI setzen."
|