mirror of
https://github.com/PurpleComputing/mdmscripts.git
synced 2026-02-03 06:03:26 +00:00
updates to avoid Monterey /tmp/ corruption issues
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.3
|
||||
# Version: 1.7
|
||||
#
|
||||
# - 1.0 Martyn Watts, 25.06.2021 Initial Build
|
||||
# - 1.1 Martyn Watts, 01.07.2021 Increased script feedback
|
||||
@@ -22,6 +22,8 @@
|
||||
# - 1.4 Martyn Watts, 28.09.2021 Added Open Console Parameter to use with TeamViewer
|
||||
# - 1.5 Martyn Watts, 29.09.2021 Removed erroneous space in deplog path, moved the Open Console section to below the initial creation event
|
||||
# & Created a scriptver variable that is recorded in the log files
|
||||
# - 1.6 Martyn Watts, 02.12.2021 Fixed issue with version checking changed the initial grep from 'download' to '>download<'
|
||||
# - 1.7 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to download and install 1Password 7.
|
||||
@@ -32,9 +34,15 @@ releaseNotesUrl='https://app-updates.agilebits.com/product_history/OPM7'
|
||||
dnldfile='1Password.pkg'
|
||||
appName='1Password 7'
|
||||
forceQuit='Y'
|
||||
logfile="/Library/Logs/1Password7InstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/1Password7InstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
scriptver="1.5"
|
||||
scriptver="1.7"
|
||||
|
||||
# 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/
|
||||
|
||||
|
||||
/bin/echo "Status: Installing ${appName}" >> ${deplog}
|
||||
/bin/echo "Status: Installing ${appName}" >> ${logfile}
|
||||
@@ -84,7 +92,7 @@ url=$(curl -s ${releaseNotesUrl} | grep '>download<' | grep -vim 1 'beta' | cut
|
||||
/bin/echo "Available ${appName} version: ${latestver}"
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/bin/echo "Downloading newer version."
|
||||
/usr/bin/curl -s -o /tmp/${dnldfile} ${url}
|
||||
/usr/bin/curl -s -o /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} ${url}
|
||||
if [[ "${forceQuit}" = "Y" ]]; then
|
||||
killall ${appName}
|
||||
fi
|
||||
@@ -93,7 +101,7 @@ url=$(curl -s ${releaseNotesUrl} | grep '>download<' | grep -vim 1 'beta' | cut
|
||||
# Uncomment this block for dmg & .app copy #
|
||||
########################################################################################
|
||||
# /bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
# /usr/bin/hdiutil attach /tmp/${dnldfile} -nobrowse -quiet
|
||||
# /usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} -nobrowse -quiet
|
||||
# /bin/echo "`date`: Installing..." >> ${logfile}
|
||||
# ditto -rsrc "/Volumes/AppName/AppName.app" "/Applications/AppNAme.app"
|
||||
# /bin/sleep 10
|
||||
@@ -105,13 +113,13 @@ url=$(curl -s ${releaseNotesUrl} | grep '>download<' | grep -vim 1 'beta' | cut
|
||||
########################################################################################
|
||||
# Uncomment this block for .pkg install #
|
||||
########################################################################################
|
||||
cd /tmp
|
||||
cd /Library/Caches/com.purplecomputing.mdm/Apps/
|
||||
/usr/sbin/installer -pkg ${dnldfile} -target /
|
||||
########################################################################################
|
||||
|
||||
/bin/sleep 5
|
||||
/bin/echo "`date`: Deleting the downloaded file." >> ${logfile}
|
||||
/bin/rm /tmp/${dnldfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}
|
||||
|
||||
#double check to see if the new version got updated
|
||||
newlyinstalledver=`/usr/bin/defaults read "/Applications/${appName}.app/Contents/Info" CFBundleShortVersionString`
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.7
|
||||
# Version: 1.8
|
||||
#
|
||||
# - v.1.0 Joe Farage, 23.01.2015
|
||||
# - v.1.1 Joe Farage, 08.04.2015 : support for new Adobe Acrobat DC
|
||||
@@ -24,14 +24,20 @@
|
||||
# - v.1.5 Martyn Watts, 05.07.2021: fixed the latest version lookup (Lines 41-43)
|
||||
# - v.1.6 Martyn Watts, 28.09.2021: Added Open Console Parameter to use with TeamViewer
|
||||
# - v.1.7 Martyn Wattsm 29.09.2021: Added scriptver variable and sending that to the logfile to create the initial entry
|
||||
# - v.1.8 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to download and install Adobe Acrobat Updates.
|
||||
# Only works on Intel systems.
|
||||
|
||||
# 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/
|
||||
|
||||
dmgfile="acrobat.dmg"
|
||||
logfile="/Library/Logs/AdobeAcrobatDCUpdateScript.log"
|
||||
scriptver="1.6"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Apps/AdobeAcrobatDCUpdateScript.log"
|
||||
scriptver="1.8"
|
||||
|
||||
echo "Script Version: ${scriptver}" >> ${logfile}
|
||||
|
||||
@@ -86,9 +92,9 @@ if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then
|
||||
/bin/echo "`date`: Current Acrobat DC version: ${currentinstalledver}" >> ${logfile}
|
||||
/bin/echo "`date`: Available Acrobat DC version: ${latestver} => ${latestvernorm}" >> ${logfile}
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/usr/bin/curl -o /tmp/acrobat.dmg ${url}
|
||||
/usr/bin/curl -o /Library/Caches/com.purplecomputing.mdm/Apps/acrobat.dmg ${url}
|
||||
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
/usr/bin/hdiutil attach /tmp/acrobat.dmg -nobrowse -quiet
|
||||
/usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/acrobat.dmg -nobrowse -quiet
|
||||
/bin/echo "`date`: Installing..." >> ${logfile}
|
||||
/usr/sbin/installer -pkg /Volumes/AcrobatDCUpd${ARCurrVersNormalized}/AcrobatDCUpd${ARCurrVersNormalized}.pkg -target /
|
||||
|
||||
@@ -97,7 +103,7 @@ if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then
|
||||
/usr/bin/hdiutil detach /Volumes/AcrobatDCUpd${ARCurrVersNormalized} -quiet
|
||||
/bin/sleep 10
|
||||
/bin/echo "`date`: Deleting disk image." >> ${logfile}
|
||||
/bin/rm /tmp/${dmgfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dmgfile}
|
||||
|
||||
#double check to see if the new version got updated
|
||||
newlyinstalledver=`/usr/bin/defaults read /Applications/Adobe\ Acrobat\ DC/Adobe\ Acrobat.app/Contents/Info CFBundleShortVersionString`
|
||||
|
||||
18
Firefox.sh
18
Firefox.sh
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.6
|
||||
# Version: 1.7
|
||||
#
|
||||
# - 1.0 Joe Farage, 18.03.2015
|
||||
# - 1.0.1 Chris Hansen, 14.05.2020 Some square brackets change to double square brackets
|
||||
@@ -23,16 +23,22 @@
|
||||
# - 1.4 Martyn Watts, 24.09.2021 Added Check to see if dockutil is installed to make the script more resilient
|
||||
# - 1.5 Martyn Watts, 28.09.2021 Added Open Console Parameter to use with TeamViewer
|
||||
# - 1.6 Martyn Watts, 29.09.2021 Added scriptver variable and sending this to the logfile
|
||||
# - 1.7 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to download and install Firefox.
|
||||
# Only works on Intel systems.
|
||||
#
|
||||
|
||||
# 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/
|
||||
|
||||
dmgfile="FF.dmg"
|
||||
logfile="/Library/Logs/FirefoxInstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/FirefoxInstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
scriptver="1.6"
|
||||
scriptver="1.7"
|
||||
|
||||
echo "Script Version: ${scriptver}" >> ${logfile}
|
||||
|
||||
@@ -78,9 +84,9 @@ if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then
|
||||
/bin/echo "`date`: Current Firefox version: ${currentinstalledver}" >> ${logfile}
|
||||
/bin/echo "`date`: Available Firefox version: ${latestver}" >> ${logfile}
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/usr/bin/curl -s -o /tmp/${dmgfile} ${url}
|
||||
/usr/bin/curl -s -o /Library/Caches/com.purplecomputing.mdm/Apps/${dmgfile} ${url}
|
||||
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
/usr/bin/hdiutil attach /tmp/${dmgfile} -nobrowse -quiet
|
||||
/usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/${dmgfile} -nobrowse -quiet
|
||||
/bin/echo "`date`: Installing..." >> ${logfile}
|
||||
ditto -rsrc "/Volumes/Firefox/Firefox.app" "/Applications/Firefox.app"
|
||||
|
||||
@@ -89,7 +95,7 @@ if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then
|
||||
/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep Firefox | awk '{print $1}') -quiet
|
||||
/bin/sleep 10
|
||||
/bin/echo "`date`: Deleting disk image." >> ${logfile}
|
||||
/bin/rm /tmp/${dmgfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dmgfile}
|
||||
|
||||
#double check to see if the new version got updated
|
||||
newlyinstalledver=`/usr/bin/defaults read /Applications/Firefox.app/Contents/Info CFBundleShortVersionString`
|
||||
|
||||
@@ -13,25 +13,31 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.2
|
||||
# Version: 1.3
|
||||
#
|
||||
# - 1.0 Martyn Watts, 28.09.2021 Initial Build
|
||||
# - 1.1 Martyn Watts, 29.09.2021 First working build
|
||||
# - 1.2 Martyn Watts, 29.09.2021 Extended log information around the download, mount, copy & unmount operations
|
||||
# - 1.3 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
#########################################################################
|
||||
# Script to download and install LibreOffice.
|
||||
#
|
||||
|
||||
scriptver='1.2'
|
||||
scriptver='1.3'
|
||||
releaseNotesUrl='https://www.libreoffice.org/download/download/'
|
||||
dnldfile='LibreOffice.dmg'
|
||||
appName='LibreOffice'
|
||||
forceQuit='Y'
|
||||
logfile="/Library/Logs/${appName}.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/${appName}.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2"
|
||||
|
||||
# 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/
|
||||
|
||||
/bin/echo "Version: Script version ${scriptver}" >> ${deplog}
|
||||
/bin/echo "Version: Script version ${scriptver}" >> ${logfile}
|
||||
|
||||
@@ -84,27 +90,21 @@ if [[ "${currentinstalledver}" != "${latestver}" ]]; then
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/bin/echo "Downloading newer version."
|
||||
/bin/echo ${url} >> ${logfile}
|
||||
curl -o /tmp/${dnldfile} ${url}
|
||||
curl -o /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} ${url}
|
||||
if [[ "${forceQuit}" = "Y" ]]; then
|
||||
killall ${appName}
|
||||
fi
|
||||
##########################################################################
|
||||
# Uncomment this block for dmg & .app copy #
|
||||
##########################################################################
|
||||
|
||||
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
/usr/bin/hdiutil attach /tmp/${dnldfile} -nobrowse >> ${logfile}
|
||||
/usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} -nobrowse >> ${logfile}
|
||||
/bin/sleep 5
|
||||
/bin/echo "`date`: Installing..." >> ${logfile}
|
||||
ditto -rsrc "/Volumes/${appName}/${appName}.app" "/Applications/${appName}.app"
|
||||
/bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
|
||||
/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep ${appName} | awk '{print $1}') >> ${logfile}
|
||||
/bin/sleep 5
|
||||
##########################################################################
|
||||
|
||||
|
||||
/bin/sleep 5
|
||||
/bin/echo "`date`: Deleting the downloaded file." >> ${logfile}
|
||||
/bin/rm /tmp/${dnldfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}
|
||||
|
||||
# Double check to see if the new version got updated
|
||||
newlyinstalledver=`/usr/bin/defaults read "/Applications/${appName}.app/Contents/Info" CFBundleShortVersionString`
|
||||
|
||||
12
Rosetta2.sh
12
Rosetta2.sh
@@ -13,19 +13,25 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.1
|
||||
# Version: 1.2
|
||||
#
|
||||
# - 1.0 Martyn Watts, 25.06.2021 Initial Build
|
||||
# - 1.1 Martyn Watts, 29.09.2021 Removed erroneous space in deplog path, moved the Open Console section to below the initial creation event
|
||||
# & Created a scriptver variable that is recorded in the log files
|
||||
# - 1.2 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to identify architecture and install Rosetta2 if needed
|
||||
#
|
||||
|
||||
logfile="/Library/Logs/Rosetta2InstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/Rosetta2InstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
scriptver="1.1"
|
||||
scriptver="1.2"
|
||||
|
||||
# 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/
|
||||
|
||||
/bin/echo "Status: Installing ${appName}" >> ${deplog}
|
||||
/bin/echo "Status: Installing ${appName}" >> ${logfile}
|
||||
|
||||
@@ -12,9 +12,10 @@
|
||||
####################################################################################################
|
||||
# #
|
||||
# HISTORY #
|
||||
# Version: 1.0 #
|
||||
# Version: 1.1 #
|
||||
# #
|
||||
# - 1.0 Martyn Watts, 30.09.2021 Initial Build #
|
||||
# - 1.0 Martyn Watts, 30.09.2021 Initial Build
|
||||
# - 1.1 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/ #
|
||||
# #
|
||||
####################################################################################################
|
||||
|
||||
@@ -24,7 +25,7 @@
|
||||
|
||||
# The version of this script, it is used in the logs so you can see which version of the script has
|
||||
# been used and will help with script debugging
|
||||
scriptver="1.0"
|
||||
scriptver="1.1"
|
||||
|
||||
# The url of the webpage to scrape for the latest version number and download link.
|
||||
releaseNotesUrl='https://github.com/balena-io/etcher/blob/master/CHANGELOG.md'
|
||||
@@ -47,7 +48,7 @@ forceQuit='Y'
|
||||
# The 2 Log files we create as were progressing through the script
|
||||
# logfile is the main log which has each step and any errors sent to it
|
||||
# deplog is used to update the depnotify application with statuses and increments the progress bar
|
||||
logfile="/Library/Logs/balenaEtcherInstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/balenaEtcherInstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
|
||||
|
||||
@@ -55,6 +56,11 @@ deplog="/var/tmp/depnotify.log"
|
||||
# Script Startup #
|
||||
####################################################################################################
|
||||
|
||||
# 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/
|
||||
|
||||
# Create log files if they don't exist
|
||||
if [[ ! -e ${logfile} ]]; then
|
||||
/bin/echo "---- New Log ----" >> $logfile
|
||||
@@ -150,7 +156,7 @@ fi
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/bin/echo "Downloading newer version."
|
||||
url=$(curl -Ls -o /dev/null -w %{url_effective} ${downloadUrl})
|
||||
/usr/bin/curl -s -o /tmp/${dnldfile} ${url}
|
||||
/usr/bin/curl -s -o /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} ${url}
|
||||
|
||||
|
||||
# Force quit the application
|
||||
@@ -165,7 +171,7 @@ fi
|
||||
|
||||
# Mount the DMG
|
||||
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
/usr/bin/hdiutil attach /tmp/${dnldfile} -nobrowse
|
||||
/usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} -nobrowse
|
||||
|
||||
# Copy the file to the Applications folder - you may need to change the mounted volume name
|
||||
/bin/echo "`date`: Installing..." >> ${logfile}
|
||||
@@ -189,7 +195,7 @@ fi
|
||||
# Clean up after the installation
|
||||
/bin/sleep 5
|
||||
/bin/echo "`date`: Deleting the downloaded file." >> ${logfile}
|
||||
/bin/rm /tmp/${dnldfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}
|
||||
|
||||
|
||||
####################################################################################################
|
||||
|
||||
@@ -12,19 +12,20 @@
|
||||
####################################################################################################
|
||||
# #
|
||||
# HISTORY #
|
||||
# Version: 1.0 #
|
||||
# Version: 1.1 #
|
||||
# #
|
||||
# - 1.0 Martyn Watts, 30.09.2021 Initial Build #
|
||||
# #
|
||||
# - 1.1 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/# #
|
||||
####################################################################################################
|
||||
|
||||
####################################################################################################
|
||||
# Program Variables #
|
||||
####################################################################################################
|
||||
|
||||
|
||||
# The version of this script, it is used in the logs so you can see which version of the script has
|
||||
# been used and will help with script debugging
|
||||
scriptver="1.0"
|
||||
scriptver="1.1"
|
||||
|
||||
# The url of the webpage to scrape for the latest version number and download link.
|
||||
releaseNotesUrl='https://brave.com/latest/'
|
||||
@@ -47,7 +48,7 @@ forceQuit='Y'
|
||||
# The 2 Log files we create as were progressing through the script
|
||||
# logfile is the main log which has each step and any errors sent to it
|
||||
# deplog is used to update the depnotify application with statuses and increments the progress bar
|
||||
logfile="/Library/Logs/Brave-BrowserInstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/Brave-BrowserInstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
|
||||
|
||||
@@ -55,6 +56,11 @@ deplog="/var/tmp/depnotify.log"
|
||||
# Script Startup #
|
||||
####################################################################################################
|
||||
|
||||
# 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/
|
||||
|
||||
# Create log files if they don't exist
|
||||
if [[ ! -e ${logfile} ]]; then
|
||||
/bin/echo "---- New Log ----" >> $logfile
|
||||
@@ -150,7 +156,7 @@ fi
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/bin/echo "Downloading newer version."
|
||||
url=$(curl -Ls -o /dev/null -w %{url_effective} ${downloadUrl})
|
||||
/usr/bin/curl -s -o /tmp/${dnldfile} ${url}
|
||||
/usr/bin/curl -s -o /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} ${url}
|
||||
|
||||
|
||||
# Force quit the application
|
||||
@@ -165,7 +171,7 @@ fi
|
||||
|
||||
# Mount the DMG
|
||||
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
/usr/bin/hdiutil attach /tmp/${dnldfile} -nobrowse
|
||||
/usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} -nobrowse
|
||||
|
||||
# Copy the file to the Applications folder - you may need to change the mounted volume name
|
||||
/bin/echo "`date`: Installing..." >> ${logfile}
|
||||
@@ -189,7 +195,7 @@ fi
|
||||
# Clean up after the installation
|
||||
/bin/sleep 5
|
||||
/bin/echo "`date`: Deleting the downloaded file." >> ${logfile}
|
||||
/bin/rm /tmp/${dnldfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}
|
||||
|
||||
|
||||
####################################################################################################
|
||||
|
||||
@@ -13,25 +13,31 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.3
|
||||
# Version: 1.4
|
||||
#
|
||||
# - 1.0 Martyn Watts, 22.06.2021 Initial Build
|
||||
# - 1.1 Martyn Watts, 24.09.2021 Added Check to see if dockutil is installed to make the script more resilient
|
||||
# - 1.2 Martyn Watts, 28.09.2021 Added Open Console Parameter to use with TeamViewer
|
||||
# - 1.3 Martyn Watts, 29.09.2021 Added scriptver variable and sent to logfile
|
||||
# - 1.4 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/#
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to download and install BT Cloud Phone.
|
||||
# Only works on Intel systems.
|
||||
#
|
||||
|
||||
#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/
|
||||
|
||||
downloadUrl='https://downloads.ringcentral.com/sp/bt/BTCloudPhoneForMac'
|
||||
appName='BT Cloud Phone'
|
||||
dmgVolume='BT Cloud Work Phone'
|
||||
forceQuit='Y'
|
||||
logfile="/Library/Logs/BTCloudPhoneInstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/BTCloudPhoneInstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
scriptver="1.3"
|
||||
scriptver="1.4"
|
||||
|
||||
echo "Script Version: ${scriptver}" >> ${logfile}
|
||||
echo "Status: Installing ${appName}" >> ${deplog}
|
||||
@@ -74,7 +80,7 @@ dnldfile=$(echo ${url} | sed -e 's:.*/::')
|
||||
/bin/echo "Available ${appName} version: ${latestver}"
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/bin/echo "Downloading newer version."
|
||||
/usr/bin/curl -o "/tmp/${dnldfile}" ${url}
|
||||
/usr/bin/curl -o "/Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}" ${url}
|
||||
/bin/echo "`date`: Force quitting ${appName} if running." >> ${logfile}
|
||||
/bin/echo "Force quitting ${appName} if running."
|
||||
|
||||
@@ -87,7 +93,7 @@ dnldfile=$(echo ${url} | sed -e 's:.*/::')
|
||||
########################################################################################
|
||||
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
/bin/echo "Mounting installer disk image."
|
||||
/usr/bin/hdiutil attach /tmp/${dnldfile} -nobrowse -quiet
|
||||
/usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} -nobrowse -quiet
|
||||
/bin/echo "`date`: Installing..." >> ${logfile}
|
||||
/bin/echo "Installing..."
|
||||
ditto -rsrc "/Volumes/${dmgVolume}/${appName}.app" "/Applications/${appName}.app"
|
||||
@@ -101,14 +107,14 @@ dnldfile=$(echo ${url} | sed -e 's:.*/::')
|
||||
########################################################################################
|
||||
# Uncomment this block for .pkg install #
|
||||
########################################################################################
|
||||
# cd /tmp
|
||||
# cd /Library/Caches/com.purplecomputing.mdm/Apps/
|
||||
# /usr/sbin/installer -pkg ${dnldfile} -target /
|
||||
########################################################################################
|
||||
|
||||
/bin/sleep 5
|
||||
/bin/echo "`date`: Deleting the downloaded file." >> ${logfile}
|
||||
/bin/echo "Deleting the downloaded file."
|
||||
/bin/rm /tmp/${dnldfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}
|
||||
|
||||
#double check to see if the new version got updated
|
||||
newlyinstalledver=`/usr/bin/defaults read "/Applications/${appName}.app/Contents/Info" CFBundleShortVersionString`
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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/
|
||||
|
||||
# Set Pashua config location
|
||||
PashuaConfig=/tmp/Pashua.config
|
||||
PashuaConfig=/Library/Caches/com.purplecomputing.mdm/Apps/Pashua.config
|
||||
|
||||
# Download Pashua from our repo.
|
||||
curl -o /tmp/Pashua.zip https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/Helpers/Pashua.zip
|
||||
curl -o /Library/Caches/com.purplecomputing.mdm/Apps/Pashua.zip https://raw.githubusercontent.com/PurpleComputing/mdmscripts/main/Helpers/Pashua.zip
|
||||
|
||||
# Extract Pashua
|
||||
cd /tmp
|
||||
cd /Library/Caches/com.purplecomputing.mdm/Apps/
|
||||
unzip Pashua.zip
|
||||
|
||||
# Remove any legacy Pashua.config files
|
||||
rm -rf /tmp/Pashua.config
|
||||
rm -rf /Library/Caches/com.purplecomputing.mdm/Apps/Pashua.config
|
||||
|
||||
# Create Pashua config file
|
||||
echo "*.title=Gathering User Info" >> $PashuaConfig
|
||||
@@ -28,7 +33,7 @@ echo "email.width = 340" >> $PashuaConfig
|
||||
|
||||
# Launch Pashua to gather the info
|
||||
|
||||
result=`/tmp/Pashua.app/Contents/MacOS/Pashua $PashuaConfig | sed 's/ /;;;/g'`
|
||||
result=`/Library/Caches/com.purplecomputing.mdm/Apps/Pashua.app/Contents/MacOS/Pashua $PashuaConfig | sed 's/ /;;;/g'`
|
||||
|
||||
# Parse result
|
||||
for line in $result
|
||||
@@ -44,9 +49,9 @@ jamf recon -endUsername "${email}" -realname "${fullname}" -email "${email}"
|
||||
|
||||
# Cleanup tmp files
|
||||
|
||||
rm -rf /tmp/Pashua.app
|
||||
rm -rf /tmp/Pashua.zip
|
||||
rm -rf /tmp/Pashua.config
|
||||
rm -rf /Library/Caches/com.purplecomputing.mdm/Apps/Pashua.app
|
||||
rm -rf /Library/Caches/com.purplecomputing.mdm/Apps/Pashua.zip
|
||||
rm -rf /Library/Caches/com.purplecomputing.mdm/Apps/Pashua.config
|
||||
rm -rf $0
|
||||
|
||||
# Other options include
|
||||
|
||||
@@ -13,17 +13,24 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.3
|
||||
# Version: 1.4
|
||||
#
|
||||
# - v.1.0 Martyn Watts, 05.07.2021 - Initial Build
|
||||
# - v.1.1 Martyn Watts, 07.07.2021 - Added the process to kill off safari to ensure that it doesn't interfere with Acrobat install
|
||||
# - v.1.2 Martyn Watts, 08.07.2021 - Added DEPNotify Updates
|
||||
# - v.1.3 Martyn Watts, 29.09.2021 - Added scriptver variable and sent to log
|
||||
# - v.1.4 Martyn Watts, 03.12.2012 - Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
####################################################################################################
|
||||
|
||||
# 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/
|
||||
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
logfile="/Library/Logs/EnrollmentProcessCleanUp.log"
|
||||
scriptver='1.3'
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/EnrollmentProcessCleanUp.log"
|
||||
scriptver='1.4'
|
||||
|
||||
/bin/echo "Script Version: ${scriptver}" >> ${logfile}
|
||||
/bin/echo "Status: Cleaning up the Enrollment Process" >> ${deplog}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.3
|
||||
# Version: 1.6
|
||||
#
|
||||
# - 1.0 Martyn Watts, 01.07.2021 Initial Build
|
||||
# - 1.1-m Michael Tanner, 18.08.2021 Adapted for Mosyle
|
||||
@@ -21,6 +21,7 @@
|
||||
# - 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
|
||||
# - 1.6 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to download and install Google Chrome.
|
||||
@@ -32,9 +33,9 @@ url='https://dl.google.com/chrome/mac/stable/gcem/GoogleChrome.pkg'
|
||||
dnldfile='GoogleChrome.pkg'
|
||||
appName='Google Chrome'
|
||||
forceQuit='Y'
|
||||
logfile="/Library/Logs/GoogleChromeInstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/GoogleChromeInstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
scriptver='1.5'
|
||||
scriptver='1.6'
|
||||
|
||||
#Making Purple Cache directories for in the event that the helper script hasn't been run
|
||||
mkdir -p /Library/Caches/com.purplecomputing.mdm/
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
# 2021-07-09 Martyn Watts Added DEPNotify Progress Output
|
||||
# 2021-09-24 Martyn Watts Added Check to see if dockutil is installed to make the script more resilient
|
||||
# 2021-09-28 Martyn Watts Added Check for full-oc (Full Install with Open Console for TeamViewer Installs) also added better logging
|
||||
# 4.0 - Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
###
|
||||
|
||||
###
|
||||
@@ -170,16 +171,20 @@ fi
|
||||
|
||||
## Variables
|
||||
MACADMINS_URL="https://macadmins.software/latest.xml"
|
||||
TEMP_PATH="/tmp/apps"
|
||||
TEMP_PATH="/Library/Caches/com.purplecomputing.mdm/Apps/"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
logfile="/tmp/OfficeInstallScript.log"
|
||||
scriptver="3.5"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/OfficeInstallScript.log"
|
||||
scriptver="4.0"
|
||||
echo ${logfile}
|
||||
echo ${scriptver}
|
||||
|
||||
|
||||
# Main
|
||||
|
||||
# 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/
|
||||
|
||||
if [[ -d "${TEMP_PATH}" ]]; then
|
||||
echo "Removing ${TEMP_PATH}"
|
||||
rm -rf ${TEMP_PATH}
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.3
|
||||
# Version: 1.4
|
||||
#
|
||||
# - 1.0 Martyn Watts, 13.08.2021 Initial Build
|
||||
# - 1.1 Martyn Watts, 23.08.2021 Bug Fix for a incorrectly reporting failed install
|
||||
# - 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, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to download and install ScanSnap Home.
|
||||
@@ -29,9 +30,15 @@ downloadPageUrl=${siteRootUrl}'/global/dl/mac-sshoffline.html'
|
||||
appName='ScanSnap Home'
|
||||
installedAppName='ScanSnapHomeMain'
|
||||
forceQuit='Y'
|
||||
logfile="/Library/Logs/ScanSnapHomeInstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/ScanSnapHomeInstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
scriptversion="1.3"
|
||||
scriptversion="1.4"
|
||||
|
||||
# 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/
|
||||
|
||||
if [[ $@ == "openconsole" ]]; then
|
||||
open ${logfile}
|
||||
open ${deplog}
|
||||
@@ -77,19 +84,17 @@ dnldfile=$(echo $url | sed 's:.*/::')
|
||||
/bin/echo "Available ${appName} version: ${latestver}"
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/bin/echo "Downloading newer version."
|
||||
/usr/bin/curl -s -o /tmp/${dnldfile} ${url}
|
||||
/usr/bin/curl -s -o /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} ${url}
|
||||
/bin/echo "`date`: Force quitting existing app." >> ${logfile}
|
||||
/bin/echo "Force quitting existing app."
|
||||
if [[ "${forceQuit}" = "Y" ]]; then
|
||||
pkill -f ScanSnap
|
||||
fi
|
||||
|
||||
########################################################################################
|
||||
# Uncomment this block for dmg & .pkg install #
|
||||
########################################################################################
|
||||
|
||||
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
/bin/echo "Mounting installer disk image."
|
||||
/usr/bin/hdiutil attach /tmp/${dnldfile} -nobrowse -quiet
|
||||
/usr/bin/hdiutil attach /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile} -nobrowse -quiet
|
||||
/bin/echo "`date`: Installing..." >> ${logfile}
|
||||
/bin/echo "Installing..."
|
||||
dmgVolume=$(echo ${dnldfile} | cut -f1 -d'.')
|
||||
@@ -105,12 +110,9 @@ dnldfile=$(echo $url | sed 's:.*/::')
|
||||
/bin/sleep 10
|
||||
/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep '${dmgVolume}' | awk '{print $1}') -quiet
|
||||
/bin/sleep 10
|
||||
########################################################################################
|
||||
|
||||
/bin/sleep 5
|
||||
/bin/echo "`date`: Deleting the downloaded file." >> ${logfile}
|
||||
/bin/echo "Deleting the downloaded file."
|
||||
/bin/rm /tmp/${dnldfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}
|
||||
|
||||
#double check to see if the new version got updated
|
||||
newlyinstalledver=$(/usr/bin/defaults read "/Applications/${installedAppName}.app/Contents/Info" CFBundleShortVersionString)
|
||||
|
||||
37
zoom.sh
37
zoom.sh
@@ -13,11 +13,12 @@
|
||||
#
|
||||
# HISTORY
|
||||
#
|
||||
# Version: 1.1.1
|
||||
# Version: 1.2
|
||||
#
|
||||
# - 1.0 Martyn Watts, 28.09.2021 Initial Build
|
||||
# - 1.1 Martyn Watts, 28.09.2021 Initial Build
|
||||
# - 1.1.1 Martyn Watts, 28.09.2021 Initial Build
|
||||
# - 1.2 Martyn Watts, 03.12.2012 Changed the /tmp paths to /Library/Caches/com.purplecomputing.mdm/
|
||||
#
|
||||
####################################################################################################
|
||||
# Script to download and install Zoom.
|
||||
@@ -27,13 +28,17 @@ releaseNotesUrl='https://zoom.us/download'
|
||||
appName='zoom.us'
|
||||
dnldfile='zoom.pkg'
|
||||
forceQuit='Y'
|
||||
logfile="/Library/Logs/ZoomInstallScript.log"
|
||||
logfile="/Library/Caches/com.purplecomputing.mdm/Logs/ZoomInstallScript.log"
|
||||
deplog="/var/tmp/depnotify.log"
|
||||
scriptver="1.1.1"
|
||||
scriptver="1.2"
|
||||
architecture=$(/usr/bin/arch)
|
||||
OSvers_URL=$( sw_vers -productVersion | sed 's/[.]/_/g' )
|
||||
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2"
|
||||
|
||||
# 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}
|
||||
@@ -85,7 +90,7 @@ fi
|
||||
/bin/echo "`date`: Downloading newer version." >> ${logfile}
|
||||
/bin/echo "Downloading newer version."
|
||||
url=$(curl -Ls -o /dev/null -w %{url_effective} ${downloadUrl})
|
||||
/usr/bin/curl -o "/tmp/${dnldfile}" ${url}
|
||||
/usr/bin/curl -o "/Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}" ${url}
|
||||
/bin/echo "`date`: Force quitting ${appName} if running." >> ${logfile}
|
||||
/bin/echo "Force quitting ${appName} if running."
|
||||
|
||||
@@ -93,33 +98,13 @@ fi
|
||||
killall ${appName}
|
||||
fi
|
||||
|
||||
########################################################################################
|
||||
# Uncomment this block for dmg & .app copy #
|
||||
########################################################################################
|
||||
#/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
|
||||
#/bin/echo "Mounting installer disk image."
|
||||
#/usr/bin/hdiutil attach /tmp/${appName} -nobrowse -quiet
|
||||
#/bin/echo "`date`: Installing..." >> ${logfile}
|
||||
#/bin/echo "Installing..."
|
||||
#ditto -rsrc "/Volumes/${dmgVolume}/${appName}.app" "/Applications/${appName}.app"
|
||||
#/bin/sleep 10
|
||||
#/bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
|
||||
#/bin/echo "Unmounting installer disk image."
|
||||
#/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep '${dmgVolume}' | awk '{print $1}') -quiet
|
||||
#/bin/sleep 10
|
||||
########################################################################################
|
||||
|
||||
########################################################################################
|
||||
# Uncomment this block for .pkg install #
|
||||
########################################################################################
|
||||
cd /tmp
|
||||
cd /Library/Caches/com.purplecomputing.mdm/Apps/
|
||||
/usr/sbin/installer -pkg $dnldfile -target /
|
||||
########################################################################################
|
||||
|
||||
/bin/sleep 5
|
||||
/bin/echo "`date`: Deleting the downloaded file." >> ${logfile}
|
||||
/bin/echo "Deleting the downloaded file."
|
||||
/bin/rm /tmp/${dnldfile}
|
||||
/bin/rm /Library/Caches/com.purplecomputing.mdm/Apps/${dnldfile}
|
||||
|
||||
#double check to see if the new version got updated
|
||||
newlyinstalledlongver=`/usr/bin/defaults read "/Applications/${appName}.app/Contents/Info" CFBundleShortVersionString`
|
||||
|
||||
Reference in New Issue
Block a user