#!/bin/sh
FROM_FILE=/var/log/maillog
TO_FILE=/var/log/messages
basis=300
if [ $# -gt 0 ]; then
basis=$1
fi
fromTime=`stat -c '%y' "${FROM_FILE}"`
toTime=`stat -c '%y' "${TO_FILE}"`
diff=$(expr `date -d"${toTime}" +%s` - `date -d"${fromTime}" +%s`)
if [ ${diff} -gt ${basis} ]; then
exit 1
fi
exit 0
FROM_FILE=/var/log/maillog
TO_FILE=/var/log/messages
basis=300
if [ $# -gt 0 ]; then
basis=$1
fi
fromTime=`stat -c '%y' "${FROM_FILE}"`
toTime=`stat -c '%y' "${TO_FILE}"`
diff=$(expr `date -d"${toTime}" +%s` - `date -d"${fromTime}" +%s`)
if [ ${diff} -gt ${basis} ]; then
exit 1
fi
exit 0