Worklet: Install Discord client on Mac

  • 20 August 2019
  • 0 replies
  • 61 views

Userlevel 7

This worklet will check to see if Discord is installed and if it isn’t, will download and install it.

 

See this KB article for how to setup a worklet:

 

 

https://help.automox.com/hc/en-us/articles/5603324231700-Creating-a-Worklet

 

Evaluation Code:

 

 

#!/bin/bash



if [ -d "/Applications/Discord.app" ]; then

exit 0

else

exit 1

fi

 

Remediation Code:

 

 

#!/bin/bash



echo -e "Downloading Discord..."

curl -L -o "/tmp/Discord.dmg" https://discordapp.com/api/download?platform=osx



echo -e "Installing Discord..."

hdiutil attach "/tmp/Discord.dmg" -nobrowse

ditto "/Volumes/Discord/Discord.app" "/Applications/Discord.app"



echo -e "Cleaning up..."

hdiutil detach "/Volumes/Discord"

rm -f "/tmp/Discord.dmg"


This topic has been closed for comments