Skip to content

Commit

Permalink
fixed reboot
Browse files Browse the repository at this point in the history
Reboot always "changed" the plist.  Doing a simple "touch" to check the
version.
  • Loading branch information
justinrummel committed Feb 20, 2013
1 parent 415bf71 commit 45bac82
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions usr/local/bin/backProtect.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash

### Variables
day=`date '+%Y-%m-%d'`
day=`date '+%Y-%m-%d_%H-%M-%S'`
sourceDir="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/"
destineDir="/Users/Shared/XProtect/"
file="XProtect.plist"

version=`/usr/libexec/PlistBuddy -c "print :Version" /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist`

[ ! -d "${destineDir}" ] && { mkdir "${destineDir}"; }
cp "${sourceDir}${file}" "${destineDir}${day}-${file}"
[ ! -e "${destineDir}".version/"${version}" ] && {
touch "${destineDir}".version/"${version}"
cp "${sourceDir}${file}" "${destineDir}${day}-${file}"
}

0 comments on commit 45bac82

Please sign in to comment.