############################################################
# ģ	: OceanStor9000 Ѳ칤
#       : һɨ
# ʱ	: 
# 		
#	1Ƿļ/var/log/RecoverFailForDSC
############################################################
#!/bin/sh
set +x

G_INSPECT_MMLPATH="/opt/huawei/snas/script/inspect_mml"
source $G_INSPECT_MMLPATH/CheckItems
CurInspectNum="242"
CurInspectFun="$(GetInspectType $CurInspectNum)"
RESULTFILE="/tmp/tmpResult${CurInspectFun}"
LOG_FILE="/var/log/inspect.log"
>${RESULTFILE}

function LOG
{
   time=$(date)
   echo [${time}][$$][${CurInspectFun}]$@ >> ${LOG_FILE}
}

#242 һɨ
function main
{
    local Result=""
    local isPass=0
    local tmpInfo=""
    local lineNum=0
    local FailTime=""
    local DSCFile="/var/log/RecoverFailForDSC"
    
    if [ -f "${DSCFile}" ];then
        tmpInfo=$(stat ${DSCFile})
        lineNum=$(echo "${tmpInfo}" | awk 'END {print NR}')
        if [ ${lineNum} -gt 1 ];then
            isPass=1
            FailTime=$(echo "${tmpInfo}" | grep Modify |awk '{print $2 " " $3}'| awk -F . '{print $1}')
            Result="[ERR]INFO: ${FailTime}"
        fi
    fi
    
    if [ $isPass -eq 0 ];then
        Result="INFO: Pass"
    fi
    
    echo "${Result}" >> ${RESULTFILE}
    echo "${CurInspectFun}_Pass $isPass" >>${RESULTFILE}
    return 0
}

main
exit 0
