Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
Addes /usr/local/bin script and LaunchDaemon file
  • Loading branch information
justinrummel committed Feb 19, 2013
1 parent 47cdf3f commit 95ae31e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Library/LaunchDaemons/com.stonyrivertech.XProtect.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.rummel.XProtect</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/backProtect.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.plist</string>
</array>
</dict>
</plist>
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
XProtectWatch
=============

This a tool to copy the XProtect.plist file whenever it changes via LaunchDaemon. This is not a managment system for XProtect.
This a tool to copy the XProtect.plist file whenever it changes via LaunchDaemon. This is not a managment system for XProtect.

Copy the files as needed:

* /usr/local/bin/backProtect.sh
* /Library/LaunchDaemons/com.stonyrivertech.XProtect.plist

Be sure to chmod +x /usr/local/bin/backProtect.sh so it's an executable script and that the plist permisions are ```rw-r--r-- 1 root wheel```

11 changes: 11 additions & 0 deletions usr/local/bin/backProtect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

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


[ ! -d "${destineDir}" ] && { mkdir "${destineDir}"; }
cp "${sourceDir}${file}" "${destineDir}${day}-${file}"

0 comments on commit 95ae31e

Please sign in to comment.