From b11307e952f21f082076a9e9797f4cf946e98c8f Mon Sep 17 00:00:00 2001 From: Justin Rummel Date: Wed, 20 Feb 2013 16:28:29 -0500 Subject: [PATCH] .version/ path tweeks replaced the hard code ".version" to a variable. --- usr/local/bin/backProtect.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/local/bin/backProtect.sh b/usr/local/bin/backProtect.sh index d953b7e..dfced27 100755 --- a/usr/local/bin/backProtect.sh +++ b/usr/local/bin/backProtect.sh @@ -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}" } +` \ No newline at end of file