Exim relay daily stats – bash

#!/bin/bash
ESEND=$(egrep "(=>|->)" /var/log/exim4/mainlog.1 -c)
YDATE=$(date -d "1 day ago" '+%Y-%m-%d')
echo
echo -== Report for $YDATE ==-
echo
echo Total emails send by SMTP relay on $HOSTNAME:
echo
egrep "(=>|->)" /var/log/exim4/mainlog.1 | gawk '{ print $5 }'| sort | uniq -c | sort -nr
echo
echo Total: $ESEND
echo

output:

/root/exim-stats.sh

-== Report for 2016-02-28 ==-

Total emails send by SMTP relay on some.hostname:

20 someone@example.com
10 someone_else@email.com
1 sales@domain.com

Total: 31


Raspberry PI CPU Temperature and current speed – bash script


echo Raspberry Pi SysInfo.
echo ---------------------
MHZ=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
TEMPE=$(cat /sys/class/thermal/thermal_zone0/temp)
TEMPS=$'\xc2\xb0'C

echo Hardware:
echo CPU Speed $(($MHZ/1000)) Mhz "|" CPU Temp $(($TEMPE/1000)) $TEMPS

output:


Raspberry Pi SysInfo.
---------------------
Hardware:
CPU Speed 850 Mhz | CPU Temp 28 °C