Skip to main content
Solved

Deploying Prey by Policy (Or otherwise)

  • March 27, 2018
  • 4 replies
  • 38 views

Forum|alt.badge.img+2

Hello all,

I'm looking to deploy Prey 1.7.3 to a test MacBook. An API key is needed at the time of install. How do I incorporate that key into an install workflow? Is there a script out there already that accomplishes this? I did a search and didn't come up with anything that worked. The Policy tries .pkg first, it fails, and then the command line API key afterwards.

Thanks.

Best answer by sbrennan

@whetzelj

Hey, I stumbled across Prey in another thread that had a script to install Prey and if I could remember who posted it I would give credit. However I have blinked since then. Here is the script that I saw attached to the forgotten post.

Just create a policy that runs this script and you are good to go.

#!/bin/sh
#download prey
curl -o /private/tmp/prey-mac-1.7.3-x64.pkg "https://downloads.preyproject.com/prey-client-releases/node-client/1.7.3/prey-mac-1.7.3-x64.pkg"

#Run Prey Installer
API_KEY=YOURKEY sudo -E installer -pkg /private/tmp/prey-mac-1.7.3-x64.pkg -target /

#Remove Temp File
rm /private/tmp/prey-mac-1.7.3-x64.pkg

exit 0

This worked flawlessly.

Shaun

4 replies

Forum|alt.badge.img+4
  • New Contributor
  • Answer
  • March 27, 2018

@whetzelj

Hey, I stumbled across Prey in another thread that had a script to install Prey and if I could remember who posted it I would give credit. However I have blinked since then. Here is the script that I saw attached to the forgotten post.

Just create a policy that runs this script and you are good to go.

#!/bin/sh
#download prey
curl -o /private/tmp/prey-mac-1.7.3-x64.pkg "https://downloads.preyproject.com/prey-client-releases/node-client/1.7.3/prey-mac-1.7.3-x64.pkg"

#Run Prey Installer
API_KEY=YOURKEY sudo -E installer -pkg /private/tmp/prey-mac-1.7.3-x64.pkg -target /

#Remove Temp File
rm /private/tmp/prey-mac-1.7.3-x64.pkg

exit 0

This worked flawlessly.

Shaun


Forum|alt.badge.img+2
  • Author
  • New Contributor
  • March 27, 2018

Thanks a lot! Much appreciated.


Forum|alt.badge.img+1
  • New Contributor
  • April 22, 2019

How did you get the API_KEY from the Prey installation? Looks like a good way to send out the installer to a device you don't have your hands on.


stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • April 22, 2019

@vvanier It's on your account settings page on the Prey Project website:

Unattended Install for Computers