Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Instructions
- # Just put this script on /etc/cron.daily and set eXecute permission
- # ChangeLog
- # Added $ARCH variable
- # Added support for new Ubuntu which use Systemd instead of Upstart, so move initctl off and back is a workaround.
- # Added a log message
- # Fixed a bug. Originally "mv /sbin/initctl{,-hidden}" and "mv /sbin/initctl{-hidden,}" may be don't work, so I put the full command and all works now.
- ARCH=amd64
- CURRENT_VERSION=$(dpkg-query -W -f='${Version}\n' prey)
- PACKAGE_VERSION=$(curl -s https://s3.amazonaws.com/prey-releases/node-client/latest.txt)
- if [ "$CURRENT_VERSION" != "$PACKAGE_VERSION" ]; then
- wget -q -O"/tmp/prey.deb" https://s3.amazonaws.com/prey-releases/node-client/"$PACKAGE_VERSION"/prey_"$PACKAGE_VERSION"_$ARCH.deb
- mv /sbin/initctl /sbin/initctl-hidden
- dpkg -i /tmp/prey.deb >/dev/null 2>/dev/null
- mv /sbin/initctl-hidden /sbin/initctl
- rm -f /tmp/prey.deb
- logger "Prey Auto-Theft updated from $CURRENT_VERSION to $PACKAGE_VERSION"
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement