Advertisement
marcoshalano

update-prey

Feb 17th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.59 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. ###
  4. # Shell script to put on /etc/cron.daily to update Prey Anti-Theft software to the lastest version.
  5. ###
  6.  
  7. #CURRENT_VERSION=$(dpkg-query -s prey|grep Version|cut -d' ' -f2)
  8. CURRENT_VERSION=$(dpkg-query -W -f='${Version}\n' prey)
  9. PACKAGE_VERSION=$(curl -s https://s3.amazonaws.com/prey-releases/node-client/latest.txt)
  10.  
  11. if [ "$CURRENT_VERSION" != "$PACKAGE_VERSION" ]; then
  12.   wget -q -O"/tmp/prey.deb" https://s3.amazonaws.com/prey-releases/node-client/"$PACKAGE_VERSION"/prey_"$PACKAGE_VERSION"_amd64.deb
  13. dpkg -i /tmp/prey.deb >/dev/null 2>/dev/null
  14. rm -f /tmp/prey.deb
  15. fi
  16. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement