Browse Source

add tests and move scripts

develop
Simon Vieille 3 months ago
parent
commit
c006bbdd30
Signed by: Simon Vieille <simon@deblan.fr> GPG Key ID: 03383D15A1D31745
2 changed files with 29 additions and 0 deletions
  1. 22
    0
      generators/email
  2. 7
    0
      generators/html

+ 22
- 0
generators/email View File

@@ -0,0 +1,22 @@
#!/bin/sh

. ./helpers/template

export BOUNDARY="-$(date | md5sum | cut -d ' ' -f 1)"

(
render_template mail

if [ -n "$MUNIN_DIRECTORY" -a -d "$MUNIN_DIRECTORY" ]; then
cd "$MUNIN_DIRECTORY"

for file in *day.png; do
export file
export base64="$(base64 "$file")"

render_template mail-png-attachment
done
fi

printf "\n--%s--\n" "$BOUNDARY"
) | sendmail "$EMAIL_RECIPIENT"

+ 7
- 0
generators/html View File

@@ -0,0 +1,7 @@
#!/bin/sh

. ./helpers/template

export content="$REPORT"

render_template plain > "$HTML_OUTPUT"

Loading…
Cancel
Save