This commit is contained in:
Michael
2021-11-05 21:28:40 +00:00
parent 8167cf2e23
commit 9c9abe0e97
2 changed files with 67 additions and 3 deletions

11
Helpers/purple-helpers.sh Normal file
View File

@@ -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/

View File

@@ -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
```
##-------------------------------##
## 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
```