#!/bin/sh

/usr/sbin/logrotate /etc/logrotate_onlyAsterisk.conf > /IncLogRot.log 2>&1
result=`cat /IncLogRot.log` 

if [ "$result" != "" ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
    rm -f /var/lib/logrotate.status
    /usr/sbin/logrotate /etc/logrotate_onlyAsterisk.conf
fi
exit 0