Last active
August 29, 2015 14:03
-
-
Save vmiller/f5bd91a683298093c182 to your computer and use it in GitHub Desktop.
Script to run a Reposado repo sync and email an admin(s) only if there are changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on a script found here : | |
# https://groups.google.com/forum/#!topic/reposado/F8-rTWdb5ho | |
# | |
RUSER=reposado | |
RECIPIENTS="[email protected]" | |
PATH="/usr/share/reposado" | |
/usr/bin/python /usr/share/reposado/code/repo_sync --log /var/log/reposync.log | |
/usr/bin/python /usr/share/reposado/code/repoutil --updates | /bin/cut -d[ -f1 > ./newupdate.txt | |
if ! /usr/bin/diff ./newupdate.txt ./previousupdate.txt > ./availableupdates.txt ; then | |
for ADDR in $RECIPIENTS; do /bin/mail -s "New Apple Updates Downloaded" $ADDR < availableupdates.txt | |
done | |
fi | |
/bin/rm -f previousupdate.txt | |
/bin/mv newupdate.txt previousupdate.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment