#!/usr/bin/bash

export USER=msaulnier
export HOTE=openerp-dev
export TO="root@localhost"
export EMAIL="report@xcg-consulting.fr"

# Write mail report
echo "" > /tmp/mail_report.txt
ssh $USER@$HOTE uname -n >> /tmp/mail_report.txt
echo "===============================================================================" >> /tmp/mail_report.txt
ssh $USER@$HOTE apt-check.py -s >> /tmp/mail_report.txt
echo "" >> /tmp/mail_report.txt

# Send mail report
if which mutt >/dev/null 2>&1; then
    mutt -s "Security updates report" -i /tmp/mail_report.txt $TO
else
    echo "mutt program to send email is not installed"
fi

