AutomoxAutomox

Worklet: Install Discord client on Mac

Nic-Automox
August 19, 2019 at 10:00 pm UTC

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:

 

 

bash13 lines
#!/bin/bash



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

    exit 0

else

    exit 1

fi

 

Remediation Code:

 

 

bash23 lines
#!/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 discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack