diff --git a/hash-files b/hash-files index 4fa3895..914f0e4 100755 --- a/hash-files +++ b/hash-files @@ -1,5 +1,6 @@ #!/usr/bin/env bash log_file=/var/log/hash-files.log +keys_of_interest={"kMDItemFSCreationDate" "kMDItemFSName"} md5_bin=$(which md5sum) mktemp_bin=$(which mktemp) DateTimeStamp=$(date +\%D_\%T) @@ -36,7 +37,11 @@ mdls_files () { for line in $(mdls $file); do mdls_key=$(printf "%s" $line | cut -d '=' -f 1) mdls_value=$(printf "%s" $line | cut -d '=' -f 2) - printf "\n============================\nMDLS Key: %s\nMDLS Value: %s\n============================\n\n" $mdls_key $mdls_value + if $(grep $mdls_key $keys_of_interest);then + printf "\n============================\nMDLS Key: %s\nMDLS Value: %s\n============================\n\n" $mdls_key $mdls_value + else + : + fi done done