On branch parse-mdls
Your branch is up to date with 'origin/parse-mdls'. Changes to be committed: modified: hash-files Added default keys_of_interest array Added output filter functionality leveraging keys_of_interest
This commit is contained in:
parent
8a9f48481f
commit
fc2dae9e56
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
log_file=/var/log/hash-files.log
|
log_file=/var/log/hash-files.log
|
||||||
|
keys_of_interest={"kMDItemFSCreationDate" "kMDItemFSName"}
|
||||||
md5_bin=$(which md5sum)
|
md5_bin=$(which md5sum)
|
||||||
mktemp_bin=$(which mktemp)
|
mktemp_bin=$(which mktemp)
|
||||||
DateTimeStamp=$(date +\%D_\%T)
|
DateTimeStamp=$(date +\%D_\%T)
|
||||||
@ -36,7 +37,11 @@ mdls_files () {
|
|||||||
for line in $(mdls $file); do
|
for line in $(mdls $file); do
|
||||||
mdls_key=$(printf "%s" $line | cut -d '=' -f 1)
|
mdls_key=$(printf "%s" $line | cut -d '=' -f 1)
|
||||||
mdls_value=$(printf "%s" $line | cut -d '=' -f 2)
|
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
|
||||||
|
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user