Browse Source

add tests and move scripts

develop
Simon Vieille 1 month 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 @@
1
+#!/bin/sh
2
+
3
+. ./helpers/template
4
+
5
+export BOUNDARY="-$(date | md5sum | cut -d ' ' -f 1)"
6
+
7
+(
8
+	render_template mail
9
+
10
+	if [ -n "$MUNIN_DIRECTORY" -a -d "$MUNIN_DIRECTORY" ]; then
11
+		cd "$MUNIN_DIRECTORY"
12
+
13
+		for file in *day.png; do
14
+			export file
15
+			export base64="$(base64 "$file")"
16
+
17
+			render_template mail-png-attachment
18
+		done
19
+	fi
20
+
21
+	printf "\n--%s--\n" "$BOUNDARY"
22
+) | sendmail "$EMAIL_RECIPIENT"

+ 7
- 0
generators/html View File

@@ -0,0 +1,7 @@
1
+#!/bin/sh
2
+
3
+. ./helpers/template
4
+
5
+export content="$REPORT"
6
+
7
+render_template plain > "$HTML_OUTPUT"

Loading…
Cancel
Save