From 9c9abe0e975dd0fe8b93900a10c4806735f53103 Mon Sep 17 00:00:00 2001 From: Michael <30936296+mtan93@users.noreply.github.com> Date: Fri, 5 Nov 2021 21:28:40 +0000 Subject: [PATCH] 0511 --- Helpers/purple-helpers.sh | 11 ++++++++ MDM-Script-Pull.md | 59 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 Helpers/purple-helpers.sh diff --git a/Helpers/purple-helpers.sh b/Helpers/purple-helpers.sh new file mode 100644 index 0000000..52bd472 --- /dev/null +++ b/Helpers/purple-helpers.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Remove Old Files +rm -rf /Library/Application\ Support/Purple/* +# Pull latest files +curl -o /Library/Application\ Support/Purple/logo.png https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/PurpleLogos/logo.png +curl -o /Library/Application\ Support/Purple/logo-dark.png https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/PurpleLogos/logo-dark.png +curl -o /Library/Application\ Support/Purple/purple-icon.png https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/PurpleLogos/purple-icon.png +curl -o /Library/Application\ Support/Purple/launch-dep.sh https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/Helpers/launch-dep.sh +curl -o /Library/Application\ Support/Purple/launch-dep-en.sh https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/Helpers/launch-dep-en.sh +# Give full permissions +chmod -R 777 /Library/Application\ Support/Purple/ \ No newline at end of file diff --git a/MDM-Script-Pull.md b/MDM-Script-Pull.md index 6dcef8c..42e50c9 100644 --- a/MDM-Script-Pull.md +++ b/MDM-Script-Pull.md @@ -6,14 +6,45 @@ chmod 777 -R /tmp ##-------------------------------## ## SET VARIABLES ## + SCRIPTNAME=[[fix-outlook-spotlight.sh]] REPO=[[troubleshooting]] BRANCH=[[main]] +APPNAME='APPNAME' + +##-------------------------------## +## PREFLIGHT SCRIPT ## +##-------------------------------## + +# CLEAN UP PREVIOUS FILES +rm -rf /tmp/$SCRIPTNAME +rm -rf /tmp/brandDEPinstall.sh + +# REMOVE APPS AND FILES +killall $appname +rm -rf /Applications/$appname.app + +##-------------------------------## +## DEPNOTIFY WINDOW ## +##-------------------------------## + +# SET APP TITLE TO APPNAME +echo $appname >> /tmp/.appinstallname + +# SET DEP NOTIFY FOR REINSTALL +curl -o /tmp/brandDEPinstall.sh https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/Helpers/brandDEPinstall.sh +chmod +x /tmp/brandDEPinstall.sh +/tmp/brandDEPinstall.sh +sleep 2s +chmod 777 /var/tmp/depnotify.log + +# START DEPNOTIFY +sudo -u %LastConsoleUser% /Library/Application\ Support/Purple/launch-dep.sh + ##-------------------------------## ## START SCRIPT ## ##-------------------------------## -# CLEAN UP PREVIOUS FILE -rm -rf /tmp/$SCRIPTNAME + # DOWNLOAD LATEST FILE curl -o /tmp/$SCRIPTNAME https://raw.githubusercontent.com/PurpleComputing/$REPO/$BRANCH/$SCRIPTNAME # GIVE EXECUTE PERMISSIONS @@ -21,4 +52,26 @@ sudo -u $(stat -f "%Su" /dev/console) /bin/sh <<'END' chmod +x /tmp/$SCRIPTNAME # RUN AS CURRENT USER /tmp/$SCRIPTNAME >> /tmp/$SCRIPTNAME.log -``` \ No newline at end of file + +##-------------------------------## +## DEPNOTIFY CLOSE ## +##-------------------------------## + +# CLOSE DEP NOTIFY WINDOW +echo Status: $appname Install Complete >> /var/tmp/depnotify.log +sleep 10s +killall DEPNotify + +##-------------------------------## +## POSTFLIGHT SCRIPT ## +##-------------------------------## + +rm -rf /tmp/$scriptfilename +rm -rf /tmp/.appinstallname +rm -rf /tmp/brandDEPinstall.sh + +# END SCRIPT WITH SUCCESS +exit 0 + +``` +