From 40d236345a99f94ab09db2a43c16b3654c2b016c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 13 Jun 2019 11:02:49 +0200 Subject: [PATCH] add logo configuration --- README.md | 6 ++++++ report | 3 +++ scripts/header | 8 ++++++++ templates/deblan/header.tpl | 2 +- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 895387e..efc8568 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,12 @@ Inclure les graphiques du jour générés par Munin (rapport mail uniquement) : export MUNIN_DIRECTORY="/var/cache/munin/www/foo/bar/" ``` +Utiliser votre logo : + +```bash +export LOGO_URL=https://www.example.com/logo.png +``` + Le projet inclut un rendu HTML et un rendu en texte. Le rendu par défaut est l'HTML. Vous pouvez créer vos templates (se référer au code source). diff --git a/report b/report index d7732ba..203d34d 100755 --- a/report +++ b/report @@ -8,6 +8,9 @@ # export MUNIN_DIRECTORY=/var/cache/munin/www/localhost/localhost # export SMART_DEVICES="/dev/sda /dev/sdb /dev/sdc" +# export LOGO_URL= +# -> default is: https://upload.deblan.org/u/2019-05/5cefbc0a.png + export PATH=/usr/sbin:/usr/bin:/sbin:/bin export SCRIPT_NAME="$(realpath "$0")" diff --git a/scripts/header b/scripts/header index f83cb31..e244166 100755 --- a/scripts/header +++ b/scripts/header @@ -7,4 +7,12 @@ export hostname="$(get_hostname)" export date="$(get_date)" +if [ -n "$LOGO_URL" ]; then + logo="$LOGO_URL" +else + logo="https://upload.deblan.org/u/2019-05/5cefbc0a.png" +fi + +export logo + render_template header diff --git a/templates/deblan/header.tpl b/templates/deblan/header.tpl index 835c82a..f8ab181 100644 --- a/templates/deblan/header.tpl +++ b/templates/deblan/header.tpl @@ -48,7 +48,7 @@
- +