Skip to content

Commit

Permalink
.version/ path tweeks
Browse files Browse the repository at this point in the history
replaced the hard code ".version" to a variable.
  • Loading branch information
justinrummel committed Feb 20, 2013
1 parent 45bac82 commit b11307e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions usr/local/bin/backProtect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
day=`date '+%Y-%m-%d_%H-%M-%S'`
sourceDir="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/"
destineDir="/Users/Shared/XProtect/"
XPath=".version/"
file="XProtect.plist"
version=`/usr/libexec/PlistBuddy -c "print :Version" /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist`

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

`

0 comments on commit b11307e

Please sign in to comment.