mirror of
https://github.com/PurpleComputing/mdmscripts.git
synced 2026-02-03 06:03:26 +00:00
fix paths
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Remove Old Files
|
||||
mkdir -p /Library/Application\ Support/Purple/
|
||||
rm -rf /Library/Application\ Support/Purple/*
|
||||
rm -rf /Library/Caches/com.purplecomputing.mdm/Logs/
|
||||
|
||||
# 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
|
||||
@@ -10,7 +14,11 @@ curl -o /Library/Application\ Support/Purple/launch-dep-en.sh https://raw.github
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/Scripts
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/Apps
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/Logs
|
||||
mkdir -p /Library/Logs/com.purplecomputing.mdm/
|
||||
ln -s /Library/Logs/com.purplecomputing.mdm/ /tmp/purple-logs/
|
||||
ln -s /Library/Logs/com.purplecomputing.mdm/ /Library/Caches/com.purplecomputing.mdm/Logs/
|
||||
|
||||
# Give full permissions
|
||||
chmod -R 777 /Library/Application\ Support/Purple/
|
||||
chmod -R 777 /Library/Caches/com.purplecomputing.mdm/
|
||||
chmod 777 /var/tmp/depnotify.log
|
||||
4
MDM-Script-Pull.md
Normal file → Executable file
4
MDM-Script-Pull.md
Normal file → Executable file
@@ -42,7 +42,7 @@ curl -o /Library/Caches/com.purplecomputing.mdm/Scripts/brandDEPinstall.sh https
|
||||
chmod +x /Library/Caches/com.purplecomputing.mdm/Scripts/brandDEPinstall.sh
|
||||
/Library/Caches/com.purplecomputing.mdm/Scripts/brandDEPinstall.sh >> /Library/Caches/com.purplecomputing.mdm/Logs/brandDEPinstall.log
|
||||
sleep 2s
|
||||
chmod 777 /var/private/var/tmp/depnotify.log
|
||||
chmod 777 /var/tmp/depnotify.log
|
||||
rm -rf /Library/Caches/com.purplecomputing.mdm/Scripts/brandDEPinstall.sh
|
||||
|
||||
# START DEPNOTIFY
|
||||
@@ -64,7 +64,7 @@ sudo /Library/Caches/com.purplecomputing.mdm/Scripts/$SCRIPTNAME >> /Library/Cac
|
||||
##-------------------------------##
|
||||
|
||||
# CLOSE DEP NOTIFY WINDOW
|
||||
echo Status: $APPNAME Install Complete >> /var/private/var/tmp/depnotify.log
|
||||
echo Status: $APPNAME Install Complete >> /var/tmp/depnotify.log
|
||||
sleep 10s
|
||||
killall DEPNotify
|
||||
|
||||
|
||||
14
google-chrome.sh
Normal file → Executable file
14
google-chrome.sh
Normal file → Executable file
@@ -20,6 +20,7 @@
|
||||
# - 1.2 Martyn Watts, 24.09.2021 Added Check to see if dockutil is installed to make the script more resilient
|
||||
# - 1.3 Martyn Watts, 28.09.2021 Added Open Console Parameter to use with TeamViewer
|
||||
# - 1.4 Martyn Watts, 29.09.2021 Added scriptver variable and corrected log opening
|
||||
# - 1.5 Michael Tanner, 06.11.2021
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to download and install Google Chrome.
|
||||
@@ -33,7 +34,12 @@ appName='Google Chrome'
|
||||
forceQuit='Y'
|
||||
logfile="/Library/Logs/GoogleChromeInstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
scriptver='1.4'
|
||||
scriptver='1.5'
|
||||
|
||||
#Making Purple Cache directories for in the event that the helper script hasn't been run
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/Logs/
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/Apps/
|
||||
|
||||
echo "Script Version: ${scriptver}" >> ${logfile}
|
||||
echo "Status: Installing ${appName}" >> ${deplog}
|
||||
@@ -48,13 +54,13 @@ fi
|
||||
# To get just the latest version number from the version check URL
|
||||
/bin/echo "`date`: Downloading latest version." >> ${logfile}
|
||||
/bin/echo "Downloading latest version."
|
||||
/usr/bin/curl -o "/tmp/${dnldfile}" ${url}
|
||||
/usr/bin/curl -o "/Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}" ${url}
|
||||
/bin/echo "`date`: Expanding package." >> ${logfile}
|
||||
/bin/echo "Expanding package."
|
||||
pkgutil --expand "/tmp/${dnldfile}" /tmp/pkg
|
||||
pkgutil --expand "/Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}" /Library/Caches/com.purplecomputing.mdm/Apps/pkg
|
||||
/bin/echo "`date`: Storing latest version data." >> ${logfile}
|
||||
/bin/echo "Storing latest version data."
|
||||
latestver=$(cat /tmp/pkg/Distribution | grep 'CFBundleShortVersionString' | cut -f2 -d '"')
|
||||
latestver=$(cat /Library/Caches/com.purplecomputing.mdm/Apps/pkg/Distribution | grep 'CFBundleShortVersionString' | cut -f2 -d '"')
|
||||
/bin/echo "`date`: Removing expanded package" >> ${logfile}
|
||||
/bin/echo "Removing expanded package."
|
||||
/bin/rm -rf /tmp/pkg
|
||||
|
||||
21
zerotier.sh
Normal file → Executable file
21
zerotier.sh
Normal file → Executable file
@@ -13,34 +13,41 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.2
|
||||
# Version: 1.3
|
||||
#
|
||||
# - 1.0 Martyn Watts, 25.06.2021 Initial Script Template Build
|
||||
# - 1.1 Michael Tanner, 28.09.2021 Implement ZeroTier Install Script
|
||||
# - 1.2 Martyn Watts, 29.09.2021 Added logging information
|
||||
# - 1.3 Michael Tanner, 06.11.2021 fixing /tmp folder usage for Monterey
|
||||
#
|
||||
#########################################################################
|
||||
# Script to install ZeroTier and to join the organisations ZT Network.
|
||||
#
|
||||
scriptver='1.2'
|
||||
logfile="/Library/Logs/ZeroTierInstallScript.log"
|
||||
scriptver='1.3'
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/ZeroTierInstallScript.log"
|
||||
appName="ZeroTier"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
|
||||
#Making Purple Cache directories for in the event that the helper script hasn't been run
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/Logs/
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/Apps/
|
||||
|
||||
echo "Status: Installing ${appName} using script version ${scriptver}" >> ${deplog}
|
||||
echo "Status: Installing ${appName} using script version ${scriptver}" >> ${logfile}
|
||||
|
||||
echo "Status: Downloading ZeroTier" >> ${logfile}
|
||||
echo "Status: Downloading ZeroTier" >> ${deplog}
|
||||
curl -o /tmp/apps/ZT.pkg https://download.zerotier.com/dist/ZeroTier%20One.pkg
|
||||
curl -o /Library/Caches/com.purplecomputing.mdm/Apps/ZT.pkg https://download.zerotier.com/dist/ZeroTier%20One.pkg
|
||||
|
||||
echo "Status: Running the installer" >> ${logfile}
|
||||
echo "Status: Running the installer" >> ${deplog}
|
||||
installer -pkg /tmp/apps/ZT.pkg -target /
|
||||
installer -pkg /Library/Caches/com.purplecomputing.mdm/Apps/ZT.pkg -target /
|
||||
|
||||
echo "Status: Cleaning up after the installer" >> ${logfile}
|
||||
echo "Status: Cleaning up after the installer" >> ${deplog}
|
||||
rm -rf /tmp/apps/ZT.pkg
|
||||
sleep 2s
|
||||
rm -rf /Library/Caches/com.purplecomputing.mdm/Apps/ZT.pkg
|
||||
sleep 2
|
||||
|
||||
echo "Status: Joining ZeroTier to network ${@}" >> ${logfile}
|
||||
echo "Status: Joining ZeroTier to network ${@}" >> ${deplog}
|
||||
|
||||
Reference in New Issue
Block a user