No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

new-check-empreintes.sh 856B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. #######################
  3. ## ##
  4. ## HIDS By GotExx ##
  5. ## ##
  6. #######################
  7. NC='\033[0m'
  8. path=/home/hugo/sites/wordpress
  9. check_file="checkedfile.checksum"
  10. new_check_file="new-checkedfile.checksum"
  11. text_file=$1
  12. rm -f $new_check_file
  13. for line in $(cat $text_file);
  14. do
  15. current_time=$(date +%D-%T)
  16. sha1sum $path/$line >> ./$new_check_file
  17. done
  18. empreinte_file=`sha1sum $check_file`
  19. empreinte_new_file=`sha1sum $new_check_file`
  20. if [ `echo "$empreinte_file" | awk -F' ' {'print $1'}` != `echo "$empreinte_new_file" | awk -F' ' {'print $1'}` ];then
  21. echo "0 $current_time;" >> history.txt
  22. elif [ `echo "$empreinte_file" | awk -F' ' {'print $1'}` == `echo "$empreinte_new_file" | awk -F' ' {'print $1'}` ];then
  23. echo "1 $current_time;" >> history.txt
  24. else
  25. echo "2 $current_time;" >> history.txt
  26. fi