From 9832da8b0307fe798aec15c08bb1a36a32be18cd Mon Sep 17 00:00:00 2001 From: Tristan Date: Wed, 13 Mar 2019 14:37:49 +0100 Subject: [PATCH] Check whether the send of a mail after every reboot is present in the rc.local file --- evocheck.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/evocheck.sh b/evocheck.sh index d927383..bf0a72c 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -949,6 +949,17 @@ if [ `uname -s` == "OpenBSD" ]; then fi fi + if [ "$IS_REBOOTMAIL" = 1 ]; then + if [ -f /etc/rc.local ]; then + grep -qE '^date | mail -s "boot/reboot of' /etc/rc.local || echo 'IS_REBOOTMAIL FAILED!' + else + echo 'IS_REBOOTMAIL FAILED!' + if [[ "$VERBOSE" == 1 ]]; then + echo "Make sure /etc/rc.local exist and 'date | mail -s \"boot/reboot of $hostname' is present!" + fi + fi + fi + if [ "$IS_SOFTDEP" = 1 ]; then grep -q "softdep" /etc/fstab || echo 'IS_SOFTDEP FAILED!' fi