This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
touch /tmp/raid-report.txt | |
echo "Subject: Qnap RAID report" >> /tmp/raid-report.txt | |
echo "From: [email protected]" >> /tmp/raid-report.txt | |
echo "To: [email protected]" >> /tmp/raid-report.txt | |
echo "" >> /tmp/raid-report.txt | |
echo "RAID log" >> /tmp/raid-report.txt | |
echo "==================================" >> /tmp/raid-report.txt | |
mdadm --query --detail /dev/md2 >> /tmp/raid-report.txt | |
cat /tmp/raid-report.txt | sendmail -t |