add tests and move scripts
This commit is contained in:
parent
c006bbdd30
commit
a555aadc33
|
@ -11,13 +11,13 @@ if ! which envsubst 2>/dev/null >/dev/null; then
|
|||
fi
|
||||
|
||||
if ! which base64 2>/dev/null >/dev/null; then
|
||||
printf "Le programme \`envsubst\` est nécessaire. Installer \`coreutils\`.\n"
|
||||
printf "Le programme \`base64\` est nécessaire. Installer \`coreutils\`.\n"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! which smartcl 2>/dev/null >/dev/null; then
|
||||
printf "Le programme \`envsubst\` est nécessaire. Installer \`smartmontools\`.\n"
|
||||
if test -n "$SMART_DEVICES" && ! which smartcl 2>/dev/null >/dev/null; then
|
||||
printf "Le programme \`smartcl\` est nécessaire. Installer \`smartmontools\`.\n"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
|
8
report
8
report
|
@ -26,20 +26,24 @@ REPORT="$(
|
|||
./scripts/system
|
||||
./scripts/mount
|
||||
./scripts/df
|
||||
|
||||
if [ -n "$SMART_DEVICES" ]; then
|
||||
./scripts/smart
|
||||
fi
|
||||
|
||||
./scripts/footer
|
||||
)"
|
||||
|
||||
if [ -n "$HTML_OUTPUT" ]; then
|
||||
export REPORT
|
||||
|
||||
./scripts/html
|
||||
./generators/html
|
||||
fi
|
||||
|
||||
if [ -n "$EMAIL_RECIPIENT" ]; then
|
||||
export REPORT
|
||||
|
||||
./scripts/email
|
||||
./generators/email
|
||||
fi
|
||||
|
||||
./hooks/on-finish
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
#!/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"
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./helpers/template
|
||||
|
||||
export content="$REPORT"
|
||||
|
||||
render_template plain > "$HTML_OUTPUT"
|
Loading…
Reference in a new issue