mirror of
https://github.com/PurpleComputing/mdmscripts.git
synced 2026-02-03 14:13:27 +00:00
0511
This commit is contained in:
11
Helpers/purple-helpers.sh
Normal file
11
Helpers/purple-helpers.sh
Normal 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/
|
||||
@@ -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
|
||||
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user