
#!/bin/sh
# File	: mail-status.sh
# By	: MaartenDeBoer.nl, 161220
# Subject	: Scripts to mail the status
PGM="`basename $0|cut -d\. -f1`"
VER="0.1"
TMP="/tmp/${PGM}.$$"
LOG="${HOME}/log/${PGM}.log"
HOSTNAME="`hostname|cut -d\. -f1`"
MAILTO="maarten@agrarix.net"


touch ${TMP}
echo "HOSTNAME=`hostname`" >> ${TMP}
echo "UPTIME=`uptime`" >> ${TMP}
echo "DF-H=`df -h`" >> ${TMP}
echo "DATISTRUTC=`date +%Y%m%d%H%M%S --utc`" >> ${TMP}
echo "PGM=${PGM} v${VER}" >> ${TMP}

cat ${TMP}|mailx -s "status:${HOSTNAME}" ${MAILTO}
echo "`date` ${PGM} v${VER}: Mailed ${NAME} to ${MAILTO}"|tee -a ${LOG}


rm ${TMP}
exit 0

