Wednesday, November 09, 2016

md5sum files in directories and check

job()
{
    while true
    do
        find bin/ etc/ lib/ sbin/ selinux/ system/ usr/ -type f -exec md5sum \{\} \; > $name
        cal=`md5sum $name | awk -e "{print \\$1}"`
        if [ $cal != 207c55670e306a3a06ea87456e0859da ]
        then
            echo Mismatch
            break
        fi
        sleep $(( ($RANDOM % 20 )  + 1 ))
    done
}

No comments: