You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

50 lines
878 B

#!/bin/sh
# export EMAIL_RECIPIENT=you@example.com
# export EMAIL_SENDER=system@example.com
# export EMAIL_SUBJECT="[$(hostname)] Rapport journalier"
# export HTML_OUTPUT=/tmp/report.html
# export MUNIN_DIRECTORY=/var/cache/munin/www/localhost/localhost
# export SMART_DEVICES="/dev/sda /dev/sdb /dev/sdc"
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
export SCRIPT_NAME="$(realpath "$0")"
export SCRIPT_PATH="$(dirname "$SCRIPT_NAME")"
if [ -z "$TEMPLATE" ]; then
export TEMPLATE="$SCRIPT_PATH/templates/deblan"
fi
cd "$SCRIPT_PATH"
./hooks/on-start
REPORT="$(
./scripts/header
./scripts/system
./scripts/mount
./scripts/df
if [ -n "$SMART_DEVICES" ]; then
./scripts/smart
fi
./scripts/footer
)"
if [ -n "$HTML_OUTPUT" ]; then
export REPORT
./generators/html
fi
if [ -n "$EMAIL_RECIPIENT" ]; then
export REPORT
./generators/email
fi
./hooks/on-finish