#!/bin/sh # OPENDJ-29969 check # ## Created by Lee Trujillo (lee.trujillo@forgerock.com) ## ## CDDL HEADER START ## ## The contents of this file are subject to the terms of the ## Common Development and Distribution License, Version 1.0 only ## (the "License"). You may not use this file except in compliance ## with the License. ## ## You can obtain a copy of the license at ## trunk/opends/resource/legal-notices/OpenDS.LICENSE ## or https://OpenDS.dev.java.net/OpenDS.LICENSE. ## See the License for the specific language governing permissions ## and limitations under the License. ## ## When distributing Covered Code, include this CDDL HEADER in each ## file and include the License file at ## trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, ## add the following below this CDDL HEADER, with the fields enclosed ## by brackets "[]" replaced with your own identifying information: ## Portions Copyright [yyyy] [name of copyright owner] ## ## CDDL HEADER END ## ## Copyright 2016 ForgeRock AS. ii=1 base=`basename $PWD` log() { echo "File $file Size $size bytes/kb Chk1 $size / 256 = $check1 Chk2 256 x $check1 = $check2" >> ./${base}.log } date=`date "+%y%m%d-%H%M%S"` files=`find . -name "head.log" -print` for file in $files; do echo "Checking file - ${file}\n" echo "Checking file - ${file}\n" >> ./${base}.log size=`ls -l $file | awk '{print $5}'` check1=`expr ${size} / 256` check2=`expr 256 \* ${check1}` log if [ "${size}" = "${check2}" -a "${check1}" != "0" ]; then newsize=`ls -l ${file}` echo "ALERT! File -> $file found!\n\n$newsize\n\n$base" > ~/Downloads/ALERT-${base}.txt echo "Fnl \t$check2 = $size" >> ./${base}.log echo "ALERT! Match!\n" >> ./${base}.log else echo "Fnl \t$check2 != $size" >> ./${base}.log echo "Rslt\tNo issues found\n" >> ./${base}.log fi done echo "------" >> ./${base}.log ii=`expr $ii + 1` echo "Complete" echo "See ./${base}.log for details" #EOF