mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-09 05:11:59 +00:00
Compare commits
1 Commits
Detect-spc
...
cleanupAnd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b42bd7e408 |
45
CHANGELOG.md
45
CHANGELOG.md
@@ -1,46 +1,7 @@
|
||||
- if `spctl`-check is `rejected` then we now show an error that it can be due to Gatekeepr only allowing apps from App Store only. Installomator requires that all identified developers are accepted as well.
|
||||
## v10
|
||||
|
||||
## v9.1
|
||||
|
||||
**Note**: Both Google and Mozilla recommend using the pkg installers instead of the dmg downloads for managed deployments. So far, Installomator has provided labels for both. (`googlechrome` and `googlechromepkg` or `firefox` and `firefoxpkg`, respectively) Since there are problems with the dmg downloads, a future release of Installomator will _disable_ the `firefox` and `googlechrome` dmg labels. You should switch to using the respective pkg labels instead.
|
||||
|
||||
- added option for Microsoft Endpoint Manager (Intune) to `LOGO` (#446)
|
||||
- minor fixes (#427, #434, #436)
|
||||
- the `googlechrome` label now always downloads the universal version (#430)
|
||||
- new labels:
|
||||
- 1passwordcli (#429)
|
||||
- amazoncorretto8jdk (#423)
|
||||
- autodeskfusion360admininstall (#447)
|
||||
- axurerp10 (#439)
|
||||
- calcservice (#426)
|
||||
- clipy (#412)
|
||||
- dockutil (#432)
|
||||
- easyfind (#426)
|
||||
- grammarly (#444)
|
||||
- houdahspot (#426)
|
||||
- macadminspython (#431)
|
||||
- microsoftazuredatastudio (#438)
|
||||
- nanosaur (#426)
|
||||
- tembo (#426)
|
||||
- wordservice (#426)
|
||||
- xmenu (#426)
|
||||
- updated labels:
|
||||
- appcleaner (#428)
|
||||
- dialog (#435, #437)
|
||||
- googlechrome (#430)
|
||||
- microsoftdefender (#440)
|
||||
- supportapp (#426)
|
||||
- zoom and zoomgov (#426, #433)
|
||||
|
||||
|
||||
|
||||
## v9.0.1
|
||||
|
||||
- improved logging levels throughout the script #408
|
||||
- fixed a bug for `pkgindmg` style labels #408
|
||||
- changed the criteria used to locate an app in the case the it cannot be found in the default locations, this should help with some apps with similar name (Virtual Box and Box Drive, #401) #413
|
||||
- new label: WhiteBox Packages (`packages`) #415
|
||||
- modified label: `loom` (added Apple silicon download) #417
|
||||
- Now we trap the script, so if it is cancelled, we will run cleanupAndExit anyway, and have mounted diskimages unmounted and temporary files and folders removed.
|
||||
-
|
||||
|
||||
## v9
|
||||
|
||||
|
||||
350
Installomator.sh
350
Installomator.sh
@@ -80,7 +80,6 @@ LOGO=appstore
|
||||
# - mosyleb Mosyle Business
|
||||
# - mosylem Mosyle Manager (Education)
|
||||
# - addigy Addigy
|
||||
# - microsoft Microsoft Endpoint Manager (Intune)
|
||||
# path can also be set in the command call, and if file exists, it will be used.
|
||||
# Like 'LOGO="/System/Applications/App\ Store.app/Contents/Resources/AppIcon.icns"'
|
||||
# (spaces have to be escaped).
|
||||
@@ -302,8 +301,8 @@ if [[ $(/usr/bin/arch) == "arm64" ]]; then
|
||||
rosetta2=no
|
||||
fi
|
||||
fi
|
||||
VERSION="9.1"
|
||||
VERSIONDATE="2022-03-18"
|
||||
VERSION="9.0"
|
||||
VERSIONDATE="2022-02-08"
|
||||
|
||||
# MARK: Functions
|
||||
|
||||
@@ -325,10 +324,8 @@ cleanupAndExit() { # $1 = exit code, $2 message, $3 level
|
||||
reopenClosedProcess
|
||||
if [[ -n $2 && $1 -ne 0 ]]; then
|
||||
printlog "ERROR: $2" $3
|
||||
else
|
||||
printlog "$2" $3
|
||||
fi
|
||||
printlog "################## End Installomator, exit code $1 \n" REQ
|
||||
printlog "################## End Installomator, exit code $1 \n\n" REQ
|
||||
|
||||
# if label is wrong and we wanted name of the label, then return ##################
|
||||
if [[ $RETURN_LABEL_NAME -eq 1 ]]; then
|
||||
@@ -406,7 +403,7 @@ printlog(){
|
||||
curl -s -X POST https://http-intake.logs.datadoghq.com/v1/input -H "Content-Type: text/plain" -H "DD-API-KEY: $datadogAPI" -d "${log_priority} : $mdmURL : Installomator-${label} : ${VERSIONDATE//-/} : $SESSION : ${logmessage}" > /dev/null
|
||||
done <<< "$log_message"
|
||||
fi
|
||||
|
||||
|
||||
# Extra spaces
|
||||
space_char=""
|
||||
if [[ ${#log_priority} -eq 3 ]]; then
|
||||
@@ -463,10 +460,10 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
|
||||
fi
|
||||
|
||||
if [ -n "$archiveName" ]; then
|
||||
downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
| awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }")
|
||||
else
|
||||
downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
| awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||
fi
|
||||
if [ -z "$downloadURL" ]; then
|
||||
@@ -483,9 +480,9 @@ versionFromGit() {
|
||||
gitusername=${1?:"no git user name"}
|
||||
gitreponame=${2?:"no git repo name"}
|
||||
|
||||
appNewVersion=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | grep tag_name | cut -d '"' -f 4 | sed 's/[^0-9\.]//g')
|
||||
appNewVersion=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | grep tag_name | cut -d '"' -f 4 | sed 's/[^0-9\.]//g')
|
||||
if [ -z "$appNewVersion" ]; then
|
||||
printlog "could not retrieve version number for $gitusername/$gitreponame" WARN
|
||||
printlog "could not retrieve version number for $gitusername/$gitreponame"
|
||||
appNewVersion=""
|
||||
else
|
||||
echo "$appNewVersion"
|
||||
@@ -529,34 +526,19 @@ getAppVersion() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# get app in targetDir, /Applications, or /Applications/Utilities
|
||||
if [[ -d "$targetDir/$appName" ]]; then
|
||||
applist="$targetDir/$appName"
|
||||
elif [[ -d "/Applications/$appName" ]]; then
|
||||
# get app in /Applications, or /Applications/Utilities, or find using Spotlight
|
||||
if [[ -d "/Applications/$appName" ]]; then
|
||||
applist="/Applications/$appName"
|
||||
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
|
||||
# targetDir="/Applications"
|
||||
# fi
|
||||
elif [[ -d "/Applications/Utilities/$appName" ]]; then
|
||||
applist="/Applications/Utilities/$appName"
|
||||
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
|
||||
# targetDir="/Applications/Utilities"
|
||||
# fi
|
||||
else
|
||||
# applist=$(mdfind "kind:application $appName" -0 )
|
||||
printlog "name: $name, appName: $appName"
|
||||
applist=$(mdfind "kind:application AND name:$name" -0 )
|
||||
# printlog "App(s) found: ${applist}" DEBUG
|
||||
# applist=$(mdfind "kind:application AND name:$appName" -0 )
|
||||
applist=$(mdfind "kind:application $appName" -0 )
|
||||
fi
|
||||
if [[ -z applist ]]; then
|
||||
printlog "No previous app found" INFO
|
||||
printlog "No previous app found" DEBUG
|
||||
else
|
||||
printlog "App(s) found: ${applist}" INFO
|
||||
printlog "App(s) found: ${applist}" DEBUG
|
||||
fi
|
||||
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
|
||||
# printlog "targetDir for installation: $targetDir" INFO
|
||||
# fi
|
||||
|
||||
appPathArray=( ${(0)applist} )
|
||||
|
||||
@@ -579,10 +561,10 @@ getAppVersion() {
|
||||
fi
|
||||
fi
|
||||
else
|
||||
printlog "could not determine location of $appName" WARN
|
||||
printlog "could not determine location of $appName"
|
||||
fi
|
||||
else
|
||||
printlog "could not find $appName" WARN
|
||||
printlog "could not find $appName"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -709,7 +691,7 @@ reopenClosedProcess() {
|
||||
processuser=$(ps aux | grep -i "${appName}" | grep -vi "grep" | awk '{print $1}')
|
||||
printlog "Reopened ${appName} as $processuser"
|
||||
else
|
||||
printlog "App not closed, so no reopen." INFO
|
||||
printlog "App not closed, so no reopen." DEBUG
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -719,7 +701,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
|
||||
# check if app exists
|
||||
if [ ! -e "$appPath" ]; then
|
||||
cleanupAndExit 8 "could not find: $appPath" ERROR
|
||||
cleanupAndExit 8 "could not find: $appPath" DEBUG
|
||||
fi
|
||||
|
||||
# verify with spctl
|
||||
@@ -751,12 +733,10 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "No update for $name!"
|
||||
fi
|
||||
cleanupAndExit 0 "No new version to install" REG
|
||||
cleanupAndExit 0 "No new version to install" INFO
|
||||
else
|
||||
printlog "Using force to install anyway."
|
||||
fi
|
||||
elif [[ -z $appversion ]]; then
|
||||
printlog "Installing $name version $appNewVersion on versionKey $versionKey."
|
||||
else
|
||||
printlog "Downloaded version of $name is $appNewVersion on versionKey $versionKey (replacing version $appversion)."
|
||||
fi
|
||||
@@ -772,7 +752,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "Error updating $name!"
|
||||
fi
|
||||
cleanupAndExit 6 "Installed macOS is too old for this app." ERROR
|
||||
cleanupAndExit 6 "Installed macOS is too old for this app." INFO
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -793,7 +773,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
|
||||
# remove existing application
|
||||
if [ -e "$targetDir/$appName" ]; then
|
||||
printlog "Removing existing $targetDir/$appName" WARN
|
||||
printlog "Removing existing $targetDir/$appName" DEBUG
|
||||
deleteAppOut=$(rm -Rfv "$targetDir/$appName" 2>&1)
|
||||
tempName="$targetDir/$appName"
|
||||
tempNameLength=$((${#tempName} + 10))
|
||||
@@ -804,21 +784,16 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
|
||||
# copy app to /Applications
|
||||
printlog "Copy $appPath to $targetDir"
|
||||
copyAppOut=$(ditto -v "$appPath" "$targetDir/$appName" 2>&1)
|
||||
copyAppStatus=$(echo $?)
|
||||
deduplicatelogs "$copyAppOut"
|
||||
printlog "Debugging enabled, App copy output was:\n$logoutput" DEBUG
|
||||
if [[ $copyAppStatus -ne 0 ]] ; then
|
||||
#if ! ditto "$appPath" "$targetDir/$appName"; then
|
||||
cleanupAndExit 7 "Error while copying:\n$logoutput" ERROR
|
||||
if ! ditto "$appPath" "$targetDir/$appName"; then
|
||||
cleanupAndExit 7 "Error while copying" ERROR
|
||||
fi
|
||||
|
||||
# set ownership to current user
|
||||
if [[ "$currentUser" != "loginwindow" && $SYSTEMOWNER -ne 1 ]]; then
|
||||
printlog "Changing owner to $currentUser" WARN
|
||||
printlog "Changing owner to $currentUser"
|
||||
chown -R "$currentUser" "$targetDir/$appName"
|
||||
else
|
||||
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel" WARN
|
||||
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel"
|
||||
chown -R root:wheel "$targetDir/$appName"
|
||||
fi
|
||||
|
||||
@@ -848,7 +823,7 @@ mountDMG() {
|
||||
dmgmountStatus=$(echo $?)
|
||||
dmgmount=$(echo $dmgmountOut | tail -n 1 | cut -c 54- )
|
||||
deduplicatelogs "$dmgmountOut"
|
||||
|
||||
|
||||
if [[ $dmgmountStatus -ne 0 ]] ; then
|
||||
#if ! dmgmount=$(echo 'Y'$'\n' | hdiutil attach "$tmpDir/$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then
|
||||
cleanupAndExit 3 "Error mounting $tmpDir/$archiveName error:\n$logoutput" ERROR
|
||||
@@ -857,7 +832,7 @@ mountDMG() {
|
||||
cleanupAndExit 3 "Error accessing mountpoint for $tmpDir/$archiveName error:\n$logoutput" ERROR
|
||||
fi
|
||||
printlog "Debugging enabled, dmgmount output was:\n$logoutput" DEBUG
|
||||
|
||||
|
||||
printlog "Mounted: $dmgmount" INFO
|
||||
}
|
||||
|
||||
@@ -874,7 +849,7 @@ installFromPKG() {
|
||||
spctlOut=$(spctl -a -vv -t install "$archiveName" 2>&1 )
|
||||
spctlStatus=$(echo $?)
|
||||
printlog "spctlOut is $spctlOut" DEBUG
|
||||
|
||||
|
||||
teamID=$(echo $spctlOut | awk -F '(' '/origin=/ {print $2 }' | tr -d '()' )
|
||||
# Apple signed software has no teamID, grab entire origin instead
|
||||
if [[ -z $teamID ]]; then
|
||||
@@ -882,7 +857,7 @@ installFromPKG() {
|
||||
fi
|
||||
|
||||
deduplicatelogs "$spctlOut"
|
||||
|
||||
|
||||
if [[ $spctlStatus -ne 0 ]] ; then
|
||||
#if ! spctlout=$(spctl -a -vv -t install "$archiveName" 2>&1 ); then
|
||||
cleanupAndExit 4 "Error verifying $archiveName error:\n$logoutput" ERROR
|
||||
@@ -916,7 +891,7 @@ installFromPKG() {
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "No update for $name!"
|
||||
fi
|
||||
cleanupAndExit 0 "No new version to install" REQ
|
||||
cleanupAndExit 0 "No new version to install" INFO
|
||||
else
|
||||
printlog "Using force to install anyway."
|
||||
fi
|
||||
@@ -990,28 +965,27 @@ installPkgInDmg() {
|
||||
if [[ -z $pkgName ]]; then
|
||||
# find first file ending with 'pkg'
|
||||
findfiles=$(find "$dmgmount" -iname "*.pkg" -type f -maxdepth 1 )
|
||||
printlog "Found pkg(s):\n$findfiles" DEBUG
|
||||
filearray=( ${(f)findfiles} )
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" ERROR
|
||||
fi
|
||||
archiveName="${filearray[1]}"
|
||||
printlog "found pkg: $archiveName"
|
||||
else
|
||||
if [[ -s "$dmgmount/$pkgName" ]] ; then # was: $tmpDir
|
||||
archiveName="$dmgmount/$pkgName"
|
||||
if ls "$tmpDir/$pkgName" ; then
|
||||
archiveName="$tmpDir/$pkgName"
|
||||
else
|
||||
# try searching for pkg
|
||||
findfiles=$(find "$dmgmount" -iname "$pkgName") # was: $tmpDir
|
||||
printlog "Found pkg(s):\n$findfiles" DEBUG
|
||||
findfiles=$(find "$tmpDir" -iname "$pkgName")
|
||||
filearray=( ${(f)findfiles} )
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg “$pkgName” in dmg $archiveName" ERROR
|
||||
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName" ERROR
|
||||
fi
|
||||
# it is now safe to overwrite archiveName for installFromPKG
|
||||
archiveName="${filearray[1]}"
|
||||
printlog "found pkg: $archiveName"
|
||||
fi
|
||||
fi
|
||||
printlog "found pkg: $archiveName"
|
||||
|
||||
# installFromPkgs
|
||||
installFromPKG
|
||||
@@ -1026,7 +1000,6 @@ installPkgInZip() {
|
||||
if [[ -z $pkgName ]]; then
|
||||
# find first file ending with 'pkg'
|
||||
findfiles=$(find "$tmpDir" -iname "*.pkg" -type f -maxdepth 2 )
|
||||
printlog "Found pkg(s):\n$findfiles" DEBUG
|
||||
filearray=( ${(f)findfiles} )
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg in zip $archiveName" ERROR
|
||||
@@ -1103,13 +1076,13 @@ runUpdateTool() {
|
||||
printlog "Error running $updateTool, Procceding with normal installation. Exit Status: $updateStatus Error:\n$logoutput" WARN
|
||||
return 1
|
||||
if [[ $type == updateronly ]]; then
|
||||
cleanupAndExit 77 "No Download URL Set, this is an update only application and the updater failed" ERROR
|
||||
cleanupAndExit 77 "No Download URL Set, this is an update only application and the updater failed" WARN
|
||||
fi
|
||||
elif [[ $updateStatus -eq 0 ]]; then
|
||||
printlog "Debugging enabled, update tool output was:\n$logoutput" DEBUG
|
||||
fi
|
||||
else
|
||||
printlog "couldn't find $updateTool, continuing normally" WARN
|
||||
printlog "couldn't find $updateTool, continuing normally"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
@@ -1126,7 +1099,7 @@ finishing() {
|
||||
message="Installed $name, version $appversion"
|
||||
fi
|
||||
|
||||
printlog "$message" REQ
|
||||
printlog "$message"
|
||||
|
||||
if [[ $currentUser != "loginwindow" && ( $NOTIFY == "success" || $NOTIFY == "all" ) ]]; then
|
||||
printlog "notifying"
|
||||
@@ -1170,28 +1143,28 @@ autoload is-at-least
|
||||
|
||||
installedOSversion=$(sw_vers -productVersion)
|
||||
if ! is-at-least 10.14 $installedOSversion; then
|
||||
printlog "Installomator requires at least macOS 10.14 Mojave." ERROR
|
||||
printlog "Installomator requires at least macOS 10.14 Mojave."
|
||||
exit 98
|
||||
fi
|
||||
|
||||
# MARK: argument parsing
|
||||
if [[ $# -eq 0 ]]; then
|
||||
if [[ -z $label ]]; then # check if label is set inside script
|
||||
printlog "no label provided, printing labels" REQ
|
||||
printlog "no label provided, printing labels"
|
||||
grep -E '^[a-z0-9\_-]*(\)|\|\\)$' "$0" | tr -d ')|\' | grep -v -E '^(broken.*|longversion|version|valuesfromarguments)$' | sort
|
||||
#grep -E '^[a-z0-9\_-]*(\)|\|\\)$' "${labelFile}" | tr -d ')|\' | grep -v -E '^(broken.*|longversion|version|valuesfromarguments)$' | sort
|
||||
exit 0
|
||||
fi
|
||||
elif [[ $1 == "/" ]]; then
|
||||
# jamf uses sends '/' as the first argument
|
||||
printlog "shifting arguments for Jamf" REQ
|
||||
printlog "shifting arguments for Jamf"
|
||||
shift 3
|
||||
fi
|
||||
|
||||
while [[ -n $1 ]]; do
|
||||
if [[ $1 =~ ".*\=.*" ]]; then
|
||||
# if an argument contains an = character, send it to eval
|
||||
printlog "setting variable from argument $1" WARN
|
||||
printlog "setting variable from argument $1"
|
||||
eval $1
|
||||
else
|
||||
# assume it's a label
|
||||
@@ -1263,31 +1236,31 @@ currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print
|
||||
# MARK: check for root
|
||||
if [[ "$(whoami)" != "root" && "$DEBUG" -eq 0 ]]; then
|
||||
# not running as root
|
||||
cleanupAndExit 6 "not running as root, exiting" ERROR
|
||||
cleanupAndExit 6 "not running as root, exiting"
|
||||
fi
|
||||
|
||||
# MARK: labels in case statement
|
||||
case $label in
|
||||
longversion)
|
||||
# print the script version
|
||||
printlog "Installomater: version $VERSION ($VERSIONDATE)" REQ
|
||||
printlog "Installomater: version $VERSION ($VERSIONDATE)"
|
||||
exit 0
|
||||
;;
|
||||
valuesfromarguments)
|
||||
if [[ -z $name ]]; then
|
||||
printlog "need to provide 'name'" ERROR
|
||||
printlog "need to provide 'name'"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z $type ]]; then
|
||||
printlog "need to provide 'type'" ERROR
|
||||
printlog "need to provide 'type'"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z $downloadURL ]]; then
|
||||
printlog "need to provide 'downloadURL'" ERROR
|
||||
printlog "need to provide 'downloadURL'"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z $expectedTeamID ]]; then
|
||||
printlog "need to provide 'expectedTeamID'" ERROR
|
||||
printlog "need to provide 'expectedTeamID'"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
@@ -1302,15 +1275,6 @@ valuesfromarguments)
|
||||
blockingProcesses=( "1Password Extension Helper" "1Password 7" "1Password (Safari)" "1PasswordNativeMessageHost" "1PasswordSafariAppExtension" )
|
||||
#forcefulQuit=YES
|
||||
;;
|
||||
1passwordcli)
|
||||
name="1Password CLI"
|
||||
type="pkg"
|
||||
#packageID="com.1password.op"
|
||||
downloadURL=$(curl -fs https://app-updates.agilebits.com/product_history/CLI | grep -m 1 -i op_apple_universal | cut -d'"' -f 2)
|
||||
appNewVersion=$(echo $downloadURL | sed -E 's/.*\/[a-zA-Z_]*([0-9.]*)\..*/\1/g')
|
||||
appCustomVersion(){ /usr/local/bin/op -v }
|
||||
expectedTeamID="2BUA8C4S2C"
|
||||
;;
|
||||
4kvideodownloader)
|
||||
name="4K Video Downloader"
|
||||
type="dmg"
|
||||
@@ -1449,13 +1413,6 @@ amazonchime)
|
||||
appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | awk '{print $2}' | sed -E 's/.*\/[a-zA-Z.\-]*-([0-9.]*)\..*/\1/g' )
|
||||
expectedTeamID="94KV3E626L"
|
||||
;;
|
||||
amazoncorretto8jdk)
|
||||
name="Amazon Corretto 8 JDK"
|
||||
type="pkg"
|
||||
downloadURL="https://corretto.aws/downloads/latest/amazon-corretto-8-x64-macos-jdk.pkg"
|
||||
appNewVersion=$(curl -s https://raw.githubusercontent.com/corretto/corretto-8/develop/CHANGELOG.md | grep "## Corretto version" | head -n 1 | awk '{ print $4; exit}')
|
||||
expectedTeamID="94KV3E626L"
|
||||
;;
|
||||
amazonworkspaces)
|
||||
# credit: Isaac Ordonez, Mann consulting (@mannconsulting)
|
||||
name="Workspaces"
|
||||
@@ -1485,10 +1442,10 @@ apparency)
|
||||
expectedTeamID="936EB786NH"
|
||||
;;
|
||||
appcleaner)
|
||||
# credit: Tadayuki Onishi (@kenchan0130)
|
||||
name="AppCleaner"
|
||||
type="zip"
|
||||
downloadURL=$(curl -fs https://freemacsoft.net/appcleaner/Updates.xml | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | tr " " "\n" | sort | tail -1 | cut -d '"' -f 2)
|
||||
appNewVersion=$(curl -fsL "https://freemacsoft.net/appcleaner/Updates.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2)
|
||||
downloadURL=$(curl -fs https://freemacsoft.net/appcleaner/Updates.xml | xpath '//rss/channel/*/enclosure/@url' 2>/dev/null | tr " " "\n" | sort | tail -1 | cut -d '"' -f 2)
|
||||
expectedTeamID="X85ZX835W9"
|
||||
;;
|
||||
applenyfonts)
|
||||
@@ -1586,16 +1543,6 @@ authydesktop)
|
||||
appNewVersion="$(curl -sfL --output /dev/null -r 0-0 "${downloadURL}" --remote-header-name --remote-name -w "%{url_effective}\n" | grep -o -E '([a-zA-Z0-9\_.%-]*)\.(dmg|pkg|zip|tbz)$' | sed -E 's/.*-([0-9.]*)\.dmg/\1/g')"
|
||||
expectedTeamID="9EVH78F4V4"
|
||||
;;
|
||||
autodeskfusion360admininstall)
|
||||
name="Autodesk Fusion 360 Admin Install"
|
||||
type="pkg"
|
||||
packageID="com.autodesk.edu.fusion360"
|
||||
downloadURL="https://dl.appstreaming.autodesk.com/production/installers/Autodesk%20Fusion%20360%20Admin%20Install.pkg"
|
||||
appNewVersion=$(curl -fs "https://dl.appstreaming.autodesk.com/production/97e6dd95735340d6ad6e222a520454db/73e72ada57b7480280f7a6f4a289729f/full.json" | sed -E 's/.*build-version":"([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+).*/\1/g')
|
||||
expectedTeamID="XXKJ396S2Y"
|
||||
appName="Autodesk Fusion 360.app"
|
||||
blockingProcesses=( "Autodesk Fusion 360" "Fusion 360" )
|
||||
;;
|
||||
autodmg)
|
||||
# credit: Mischa van der Bent (@mischavdbent)
|
||||
name="AutoDMG"
|
||||
@@ -1634,20 +1581,6 @@ awsvpnclient)
|
||||
expectedTeamID="94KV3E626L"
|
||||
appNewVersion=$(curl -is "https://beta2.communitypatch.com/jamf/v1/ba1efae22ae74a9eb4e915c31fef5dd2/patch/AWSVPNClient" | grep currentVersion | tr ',' '\n' | grep currentVersion | cut -d '"' -f 4)
|
||||
;;
|
||||
axurerp10)
|
||||
name="Axure RP 10"
|
||||
type="dmg"
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
downloadURL="https://d3uii9pxdigrx1.cloudfront.net/AxureRP-Setup-arm64.dmg"
|
||||
elif [[ $(arch) == "i386" ]]; then
|
||||
downloadURL="https://d3uii9pxdigrx1.cloudfront.net/AxureRP-Setup.dmg"
|
||||
fi
|
||||
appNewVersion=$( curl -sL https://www.axure.com/release-history | grep -Eo '[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}' -m 1 )
|
||||
expectedTeamID="HUMW6UU796"
|
||||
versionKey="CFBundleVersion"
|
||||
appName="Axure RP 10.app"
|
||||
blockingProcesses=( "Axure RP 10" )
|
||||
;;
|
||||
balenaetcher)
|
||||
name="balenaEtcher"
|
||||
type="dmg"
|
||||
@@ -1775,13 +1708,6 @@ cakebrew)
|
||||
appNewVersion=$( curl -fsL "https://www.cakebrew.com/appcast/profileInfo.php" | xpath '//rss/channel/item[1]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 )
|
||||
expectedTeamID="R85D3K8ATT"
|
||||
;;
|
||||
calcservice)
|
||||
name="CalcService"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" "https://www.devontechnologies.com/support/download" | tr '"' "\n" | grep -o "http.*download.*.zip" | grep -i calcservice | head -1)"
|
||||
appNewVersion="$(echo $downloadURL | sed -E 's/.*\/([0-9.]*)\/.*/\1/g')"
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
calibre)
|
||||
# credit: Drew Diver (@grumpydrew on MacAdmins Slack)
|
||||
name="calibre"
|
||||
@@ -1856,13 +1782,6 @@ clickshare)
|
||||
downloadURL=https://www.barco.com$(curl -fs "https://www.barco.com/en/clickshare/app" | grep -E -o '(\/\S*Download\?FileNumber=R3306192\S*ShowDownloadPage=False)' | tail -1)
|
||||
expectedTeamID="P6CDJZR997"
|
||||
;;
|
||||
clipy)
|
||||
name="Clipy"
|
||||
type="dmg"
|
||||
downloadURL=$(downloadURLFromGit Clipy Clipy)
|
||||
appNewVersion=$(versionFromGit Clipy Clipy)
|
||||
expectedTeamID="BBCHAJ584H"
|
||||
;;
|
||||
closeio)
|
||||
name="Close.io"
|
||||
type="dmg"
|
||||
@@ -2009,13 +1928,12 @@ devonthink)
|
||||
appNewVersion=$( echo ${downloadURL} | tr '/' '\n' | grep "[0-9]" | grep "[.]" | head -1 )
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
dialog|\
|
||||
swiftdialog)
|
||||
dialog)
|
||||
name="Dialog"
|
||||
type="pkg"
|
||||
packageID="au.csiro.dialogcli"
|
||||
downloadURL="$(downloadURLFromGit bartreardon swiftDialog)"
|
||||
appNewVersion="$(versionFromGit bartreardon swiftDialog)"
|
||||
downloadURL="$(downloadURLFromGit bartreardon Dialog)"
|
||||
appNewVersion="$(versionFromGit bartreardon Dialog)"
|
||||
expectedTeamID="PWA5E9TQ59"
|
||||
;;
|
||||
dialpad)
|
||||
@@ -2051,15 +1969,6 @@ docker)
|
||||
fi
|
||||
expectedTeamID="9BNSXJN65R"
|
||||
;;
|
||||
dockutil)
|
||||
name="dockutil"
|
||||
type="pkg"
|
||||
packageID="dockutil.cli.tool"
|
||||
downloadURL=$(downloadURLFromGit "kcrawford" "dockutil")
|
||||
appNewVersion=$(versionFromGit "kcrawford" "dockutil")
|
||||
expectedTeamID="Z5J8CJBUWC"
|
||||
blockingProcesses=( NONE )
|
||||
;;
|
||||
drift)
|
||||
# credit Elena Ackley (@elenaelago)
|
||||
name="Drift"
|
||||
@@ -2081,13 +1990,6 @@ easeusdatarecoverywizard)
|
||||
#appNewVersion=""
|
||||
expectedTeamID="DLLVW95FSM"
|
||||
;;
|
||||
easyfind)
|
||||
name="EasyFind"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs "https://www.devontechnologies.com/apps/freeware" | grep -o "http.*download.*.zip" | grep -i easyfind)"
|
||||
appNewVersion="$(echo $downloadURL | sed -E 's/.*\/([0-9.]*)\/.*/\1/g')"
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
egnyte)
|
||||
# credit: #MoeMunyoki from MacAdmins Slack
|
||||
name="Egnyte Connect"
|
||||
@@ -2343,8 +2245,15 @@ golang)
|
||||
googlechrome)
|
||||
name="Google Chrome"
|
||||
type="dmg"
|
||||
downloadURL="https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg"
|
||||
appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac_arm64,stable/{print $3; exit}')
|
||||
if [[ $(arch) != "i386" ]]; then
|
||||
printlog "Architecture: arm64 (not i386)"
|
||||
downloadURL="https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg"
|
||||
appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac_arm64,stable/{print $3; exit}')
|
||||
else
|
||||
printlog "Architecture: i386"
|
||||
downloadURL="https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg"
|
||||
appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac,stable/{print $3; exit}')
|
||||
fi
|
||||
expectedTeamID="EQHXZ8M8AV"
|
||||
;;
|
||||
googlechromepkg)
|
||||
@@ -2423,15 +2332,6 @@ gpgsync)
|
||||
appNewVersion="$(versionFromGit firstlookmedia gpgsync)"
|
||||
expectedTeamID="P24U45L8P5"
|
||||
;;
|
||||
grammarly)
|
||||
name="Grammarly Desktop"
|
||||
type="dmg"
|
||||
packageID="com.grammarly.ProjectLlama"
|
||||
downloadURL=$(curl -fsL "https://download-mac.grammarly.com/appcast.xml" | xpath '//rss/channel/item[1]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2)
|
||||
expectedTeamID="W8F64X92K3"
|
||||
appNewVersion=$(curl -is "https://download-mac.grammarly.com/appcast.xml" | grep sparkle:version | tr ',' '\n' | grep sparkle:version | cut -d '"' -f 4)
|
||||
appName="Grammarly Installer.app"
|
||||
;;
|
||||
grandperspective)
|
||||
name="GrandPerspective"
|
||||
type="dmg"
|
||||
@@ -2486,13 +2386,6 @@ hazel)
|
||||
appNewVersion=$(curl -fsI https://www.noodlesoft.com/Products/Hazel/download | grep -i "^location" | awk '{print $2}' | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g')
|
||||
expectedTeamID="86Z3GCJ4MF"
|
||||
;;
|
||||
houdahspot)
|
||||
name="HoudahSpot"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs https://www.houdah.com/houdahSpot/updates/cast6.php | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)"
|
||||
appNewVersion="$(curl -fs https://www.houdah.com/houdahSpot/updates/cast6.php | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)"
|
||||
expectedTeamID="DKGQD8H8ZY"
|
||||
;;
|
||||
hpeasyadmin)
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
name="HP Easy Admin"
|
||||
@@ -2902,11 +2795,7 @@ loom)
|
||||
# credit: Lance Stephens (@pythoninthegrass on MacAdmins Slack)
|
||||
name="Loom"
|
||||
type="dmg"
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
downloadURL=https://cdn.loom.com/desktop-packages/$(curl -fs https://s3-us-west-2.amazonaws.com/loom.desktop.packages/loom-inc-production/desktop-packages/latest-mac.yml | awk '/url/ && /arm64/ && /dmg/ {print $3}' | head -1)
|
||||
elif [[ $(arch) == "i386" ]]; then
|
||||
downloadURL=https://cdn.loom.com/desktop-packages/$(curl -fs https://s3-us-west-2.amazonaws.com/loom.desktop.packages/loom-inc-production/desktop-packages/latest-mac.yml | awk '/url/ && /dmg/ {print $3}' | head -1)
|
||||
fi
|
||||
downloadURL=https://cdn.loom.com/desktop-packages/$(curl -fs https://s3-us-west-2.amazonaws.com/loom.desktop.packages/loom-inc-production/desktop-packages/latest-mac.yml | awk '/url/ && /dmg/ {print $3}' | head -1)
|
||||
appNewVersion=$(curl -fs https://s3-us-west-2.amazonaws.com/loom.desktop.packages/loom-inc-production/desktop-packages/latest-mac.yml | awk '/version/ {print $2}' )
|
||||
expectedTeamID="QGD2ZPXZZG"
|
||||
;;
|
||||
@@ -2934,15 +2823,6 @@ lulu)
|
||||
appNewVersion=$(versionFromGit objective-see LuLu)
|
||||
expectedTeamID="VBG97UB4TA"
|
||||
;;
|
||||
macadminspython)
|
||||
name="MacAdmins Python"
|
||||
type="pkg"
|
||||
packageID="org.macadmins.python.recommended"
|
||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/macadmins/python/releases/latest" | awk -F '"' "/browser_download_url/ && /python_recommended_signed/ { print \$4; exit }")
|
||||
appNewVersion=$(grep -o -E '\d+\.\d+\.\d+\.\d+' <<< $downloadURL | head -n 1)
|
||||
expectedTeamID="9GQZ7KUFR6"
|
||||
blockingProcesses=( NONE )
|
||||
;;
|
||||
maccyapp)
|
||||
name="Maccy"
|
||||
type="zip"
|
||||
@@ -3039,16 +2919,6 @@ microsoftautoupdate)
|
||||
#updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate"
|
||||
#updateToolArguments=( --install --apps MSau04 )
|
||||
;;
|
||||
microsoftazuredatastudio|\
|
||||
azuredatastudio)
|
||||
name="Azure Data Studio"
|
||||
type="zip"
|
||||
downloadURL=$( curl -sL https://github.com/microsoft/azuredatastudio/releases/latest | grep 'macOS ZIP' | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" )
|
||||
appNewVersion=$(versionFromGit microsoft azuredatastudio )
|
||||
expectedTeamID="UBF8T346G9"
|
||||
appName="Azure Data Studio.app"
|
||||
blockingProcesses=( "Azure Data Studio" )
|
||||
;;
|
||||
microsoftazurestorageexplorer)
|
||||
name="Microsoft Azure Storage Explorer"
|
||||
type="zip"
|
||||
@@ -3071,9 +2941,8 @@ microsoftcompanyportal)
|
||||
updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate"
|
||||
updateToolArguments=( --install --apps IMCP01 )
|
||||
;;
|
||||
microsoftdefender|\
|
||||
microsoftdefenderatp)
|
||||
name="Microsoft Defender"
|
||||
name="Microsoft Defender ATP"
|
||||
type="pkg"
|
||||
downloadURL="https://go.microsoft.com/fwlink/?linkid=2097502"
|
||||
appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.defender.standalone"]/version' 2>/dev/null | sed -E 's/<version>([0-9.]*) .*/\1/')
|
||||
@@ -3423,13 +3292,6 @@ muzzle)
|
||||
appNewVersion=$(curl -fs https://muzzleapp.com/updates/ | grep -io 'h2.*Version.* [0-9.]*.*h2' | head -1 | sed -E 's/.*ersion *([0-9.]*).*/\1/g')
|
||||
expectedTeamID="49EYHPJ4Q3"
|
||||
;;
|
||||
nanosaur)
|
||||
name="Nanosaur"
|
||||
type="dmg"
|
||||
downloadURL=$(downloadURLFromGit jorio Nanosaur)
|
||||
appNewVersion=$(versionFromGit jorio Nanosaur)
|
||||
expectedTeamID="RVNL7XC27G"
|
||||
;;
|
||||
netnewswire)
|
||||
name="NetNewsWire"
|
||||
type="zip"
|
||||
@@ -3632,15 +3494,6 @@ pacifist)
|
||||
downloadURL="https://charlessoft.com/cgi-bin/pacifist_download.cgi?type=dmg"
|
||||
expectedTeamID="HRLUCP7QP4"
|
||||
;;
|
||||
|
||||
packages)
|
||||
#NOTE: Packages is signed but _not_ notarized, so spctl will reject it
|
||||
name="Packages"
|
||||
type="pkgInDmg"
|
||||
pkgName="Install Packages.pkg"
|
||||
downloadURL="http://s.sudre.free.fr/Software/files/Packages.dmg"
|
||||
expectedTeamID="NL5M9E394P"
|
||||
;;
|
||||
pandoc)
|
||||
name="Pandoc"
|
||||
type="pkg"
|
||||
@@ -4177,14 +4030,13 @@ superhuman)
|
||||
expectedTeamID="6XHFYUTQGX"
|
||||
;;
|
||||
supportapp)
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
name="Support"
|
||||
type="pkg"
|
||||
packageID="nl.root3.support"
|
||||
downloadURL=$(downloadURLFromGit root3nl SupportApp)
|
||||
appNewVersion=$(versionFromGit root3nl SupportApp)
|
||||
expectedTeamID="98LJ4XBGYK"
|
||||
uid=$(id -u "$currentUser")
|
||||
launchctl bootout gui/${uid} "/Library/LaunchAgents/nl.root3.support.plist"
|
||||
;;
|
||||
suspiciouspackage)
|
||||
# credit: Mischa van der Bent (@mischavdbent)
|
||||
@@ -4292,13 +4144,6 @@ telegram)
|
||||
appNewVersion=$( curl -fs https://macos.telegram.org | grep anchor | head -1 | sed -E 's/.*a>([0-9.]*) .*/\1/g' )
|
||||
expectedTeamID="6N38VWS5BX"
|
||||
;;
|
||||
tembo)
|
||||
name="Tembo"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs https://www.houdah.com/tembo/updates/cast2.xml | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)"
|
||||
appNewVersion="$(curl -fs https://www.houdah.com/tembo/updates/cast2.xml | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)"
|
||||
expectedTeamID="DKGQD8H8ZY"
|
||||
;;
|
||||
textexpander)
|
||||
name="TextExpander"
|
||||
type="dmg"
|
||||
@@ -4574,14 +4419,6 @@ wireshark)
|
||||
appNewVersion=$(curl -fs https://www.wireshark.org/download.html | grep -i "href.*_stable" | sed -E 's/.*\(([0-9.]*)\).*/\1/g')
|
||||
expectedTeamID="7Z6EMTD2C6"
|
||||
;;
|
||||
wordservice)
|
||||
name="WordService"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" "https://www.devontechnologies.com/support/download" | tr '"' "\n" | grep -o "http.*download.*.zip" | grep -i wordservice | head -1)"
|
||||
appNewVersion="$(echo $downloadURL | sed -E 's/.*\/([0-9.]*)\/.*/\1/g')"
|
||||
appNewVersion=""
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
wwdc)
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
name="WWDC"
|
||||
@@ -4604,14 +4441,6 @@ xink)
|
||||
appNewVersion=$(curl -fs "https://downloads.xink.io/macos/appcast" | xpath '(//rss/channel/item/enclosure/@sparkle:version)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)
|
||||
expectedTeamID="F287823HVS"
|
||||
;;
|
||||
xmenu)
|
||||
name="XMenu"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs "https://www.devontechnologies.com/apps/freeware" | grep -o "http.*download.*.zip" | grep -i xmenu)"
|
||||
appNewVersion="$(echo $downloadURL | sed -E 's/.*\/([0-9.]*)\/.*/\1/g')"
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
|
||||
xquartz)
|
||||
# credit: AP Orlebeke (@apizz)
|
||||
name="XQuartz"
|
||||
@@ -4677,7 +4506,6 @@ zoom)
|
||||
downloadURL="https://zoom.us/client/latest/ZoomInstallerIT.pkg"
|
||||
appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5)"
|
||||
expectedTeamID="BJ4HAAB9B3"
|
||||
versionKey="CFBundleVersion"
|
||||
;;
|
||||
zoomclient)
|
||||
name="zoom.us"
|
||||
@@ -4699,7 +4527,6 @@ zoomgov)
|
||||
downloadURL="https://www.zoomgov.com/client/latest/ZoomInstallerIT.pkg"
|
||||
appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5)"
|
||||
expectedTeamID="BJ4HAAB9B3"
|
||||
versionKey="CFBundleVersion"
|
||||
;;
|
||||
zoomrooms)
|
||||
name="ZoomRooms"
|
||||
@@ -4778,13 +4605,13 @@ zulujdk8)
|
||||
*)
|
||||
# unknown label
|
||||
#printlog "unknown label $label"
|
||||
cleanupAndExit 1 "unknown label $label" ERROR
|
||||
cleanupAndExit 1 "unknown label $label"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Are we only asked to return label name
|
||||
if [[ $RETURN_LABEL_NAME -eq 1 ]]; then
|
||||
printlog "Only returning label name." REQ
|
||||
printlog "Only returning label name."
|
||||
printlog "$name"
|
||||
echo "$name"
|
||||
exit
|
||||
@@ -4795,7 +4622,7 @@ fi
|
||||
if [[ ${INTERRUPT_DND} = "no" ]]; then
|
||||
# Check if a fullscreen app is active
|
||||
if hasDisplaySleepAssertion; then
|
||||
cleanupAndExit 1 "active display sleep assertion detected, aborting" ERROR
|
||||
cleanupAndExit 1 "active display sleep assertion detected, aborting"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -4832,11 +4659,6 @@ case $LOGO in
|
||||
LOGO="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
|
||||
if [[ -z $MDMProfileName ]]; then; MDMProfileName="MDM Profile"; fi
|
||||
;;
|
||||
microsoft)
|
||||
# Microsoft Endpoint Manager (Intune)
|
||||
LOGO="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
|
||||
if [[ -z $MDMProfileName ]]; then; MDMProfileName="Management Profile"; fi
|
||||
;;
|
||||
esac
|
||||
if [[ ! -a "${LOGO}" ]]; then
|
||||
if [[ $(sw_vers -buildVersion) > "19" ]]; then
|
||||
@@ -4845,9 +4667,9 @@ if [[ ! -a "${LOGO}" ]]; then
|
||||
LOGO="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
|
||||
fi
|
||||
fi
|
||||
printlog "LOGO=${LOGO}" INFO
|
||||
printlog "LOGO=${LOGO}"
|
||||
|
||||
printlog "Label type: $type" INFO
|
||||
printlog "Label type: $type"
|
||||
|
||||
# MARK: extract info from data
|
||||
if [ -z "$archiveName" ]; then
|
||||
@@ -4869,7 +4691,7 @@ if [ -z "$archiveName" ]; then
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
printlog "archiveName: $archiveName" INFO
|
||||
printlog "archiveName: $archiveName" DEBUG
|
||||
|
||||
if [ -z "$appName" ]; then
|
||||
# when not given derive from name
|
||||
@@ -4887,13 +4709,14 @@ if [ -z "$targetDir" ]; then
|
||||
updateronly)
|
||||
;;
|
||||
*)
|
||||
cleanupAndExit 99 "Cannot handle type $type" ERROR
|
||||
printlog "Cannot handle type $type"
|
||||
cleanupAndExit 99
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ -z $blockingProcesses ]]; then
|
||||
printlog "no blocking processes defined, using $name as default" INFO
|
||||
printlog "no blocking processes defined, using $name as default"
|
||||
blockingProcesses=( $name )
|
||||
fi
|
||||
|
||||
@@ -4909,7 +4732,8 @@ fi
|
||||
# MARK: change directory to temporary working directory
|
||||
printlog "Changing directory to $tmpDir" DEBUG
|
||||
if ! cd "$tmpDir"; then
|
||||
cleanupAndExit 1 "error changing directory $tmpDir" ERROR
|
||||
printlog "error changing directory $tmpDir"
|
||||
cleanupAndExit 1
|
||||
fi
|
||||
|
||||
# MARK: get installed version
|
||||
@@ -4932,10 +4756,10 @@ if [[ -n $appNewVersion ]]; then
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "No update for $name!"
|
||||
fi
|
||||
cleanupAndExit 0 "No newer version." REQ
|
||||
cleanupAndExit 0 "No newer version."
|
||||
fi
|
||||
else
|
||||
printlog "DEBUG mode 1 enabled, not exiting, but there is no new version of app." WARN
|
||||
printlog "DEBUG mode 1 enabled, not exiting, but there is no new version of app."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
@@ -4948,12 +4772,13 @@ if [[ (-n $appversion && -n "$updateTool") || "$type" == "updateronly" ]]; then
|
||||
if [[ $DEBUG -ne 1 ]]; then
|
||||
if runUpdateTool; then
|
||||
finishing
|
||||
cleanupAndExit 0 "updateTool has run" REQ
|
||||
cleanupAndExit 0
|
||||
elif [[ $type == "updateronly" ]];then
|
||||
cleanupAndExit 0 "type is $type so we end here." REQ
|
||||
printlog "type is $type so we end here."
|
||||
cleanupAndExit 0
|
||||
fi # otherwise continue
|
||||
else
|
||||
printlog "DEBUG mode 1 enabled, not running update tool" WARN
|
||||
printlog "DEBUG mode 1 enabled, not running update tool"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -4976,14 +4801,14 @@ else
|
||||
deduplicatelogs "$curlDownload"
|
||||
if [[ $curlDownloadStatus -ne 0 ]]; then
|
||||
#if ! curl --location --fail --silent "$downloadURL" -o "$archiveName"; then
|
||||
printlog "error downloading $downloadURL" ERROR
|
||||
printlog "error downloading $downloadURL"
|
||||
message="$name update/installation failed. This will be logged, so IT can follow up."
|
||||
if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then
|
||||
printlog "notifying"
|
||||
if [[ $updateDetected == "YES" ]]; then
|
||||
displaynotification "$message" "Error updating $name"
|
||||
displaynotification "$message" "Error updating $name" ERROR
|
||||
else
|
||||
displaynotification "$message" "Error installing $name"
|
||||
displaynotification "$message" "Error installing $name" ERROR
|
||||
fi
|
||||
fi
|
||||
printlog "File list: $(ls -lh "$archiveName")" ERROR
|
||||
@@ -5048,7 +4873,8 @@ case $type in
|
||||
installAppInDmgInZip
|
||||
;;
|
||||
*)
|
||||
cleanupAndExit 99 "Cannot handle type $type" ERROR
|
||||
printlog "Cannot handle type $type"
|
||||
cleanupAndExit 99
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -5056,4 +4882,4 @@ esac
|
||||
finishing
|
||||
|
||||
# all done!
|
||||
cleanupAndExit 0 "All done!" REQ
|
||||
cleanupAndExit 0
|
||||
|
||||
20
Labels.txt
20
Labels.txt
@@ -1,5 +1,4 @@
|
||||
1password7
|
||||
1passwordcli
|
||||
4kvideodownloader
|
||||
8x8
|
||||
abstract
|
||||
@@ -17,7 +16,6 @@ alephone
|
||||
alfred
|
||||
alttab
|
||||
amazonchime
|
||||
amazoncorretto8jdk
|
||||
amazonworkspaces
|
||||
androidfiletransfer
|
||||
anydesk
|
||||
@@ -36,14 +34,11 @@ atext
|
||||
atom
|
||||
audacity
|
||||
authydesktop
|
||||
autodeskfusion360admininstall
|
||||
autodmg
|
||||
autopkgr
|
||||
aviatrix
|
||||
awscli2
|
||||
awsvpnclient
|
||||
axurerp10
|
||||
azuredatastudio
|
||||
balenaetcher
|
||||
balsamiqwireframes
|
||||
bartender
|
||||
@@ -60,7 +55,6 @@ brave
|
||||
bugdom
|
||||
caffeine
|
||||
cakebrew
|
||||
calcservice
|
||||
calibre
|
||||
camostudio
|
||||
camtasia
|
||||
@@ -70,7 +64,6 @@ cisdem-documentreader
|
||||
citrixworkspace
|
||||
clevershare2
|
||||
clickshare
|
||||
clipy
|
||||
closeio
|
||||
cloudya
|
||||
code42
|
||||
@@ -95,11 +88,9 @@ dialpad
|
||||
discord
|
||||
diskspace
|
||||
docker
|
||||
dockutil
|
||||
drift
|
||||
dropbox
|
||||
easeusdatarecoverywizard
|
||||
easyfind
|
||||
egnyte
|
||||
element
|
||||
eraseinstall
|
||||
@@ -139,7 +130,6 @@ googlesoftwareupdate
|
||||
gotomeeting
|
||||
gpgsuite
|
||||
gpgsync
|
||||
grammarly
|
||||
grandperspective
|
||||
grasshopper
|
||||
gyazo
|
||||
@@ -147,7 +137,6 @@ gyazogif
|
||||
hancock
|
||||
handbrake
|
||||
hazel
|
||||
houdahspot
|
||||
hpeasyadmin
|
||||
hpeasystart
|
||||
hyper
|
||||
@@ -198,7 +187,6 @@ loom
|
||||
lowprofile
|
||||
lucifer
|
||||
lulu
|
||||
macadminspython
|
||||
maccyapp
|
||||
macfuse
|
||||
macports
|
||||
@@ -209,10 +197,8 @@ marathoninfinity
|
||||
mattermost
|
||||
menumeters
|
||||
microsoftautoupdate
|
||||
microsoftazuredatastudio
|
||||
microsoftazurestorageexplorer
|
||||
microsoftcompanyportal
|
||||
microsoftdefender
|
||||
microsoftdefenderatp
|
||||
microsoftedge
|
||||
microsoftedgeconsumerstable
|
||||
@@ -243,7 +229,6 @@ montereyblocker
|
||||
mowgliiitsycal
|
||||
musescore
|
||||
muzzle
|
||||
nanosaur
|
||||
netnewswire
|
||||
nextcloud
|
||||
nomad
|
||||
@@ -270,7 +255,6 @@ opera
|
||||
ottomatic
|
||||
overflow
|
||||
pacifist
|
||||
packages
|
||||
pandoc
|
||||
paretosecurity
|
||||
parsec
|
||||
@@ -350,7 +334,6 @@ sublimetext
|
||||
superhuman
|
||||
supportapp
|
||||
suspiciouspackage
|
||||
swiftdialog
|
||||
swiftruntimeforcommandlinetools
|
||||
sync
|
||||
tableaudesktop
|
||||
@@ -364,7 +347,6 @@ teamviewerhost
|
||||
teamviewerqs
|
||||
techsmithcapture
|
||||
telegram
|
||||
tembo
|
||||
textexpander
|
||||
textmate
|
||||
theunarchiver
|
||||
@@ -402,11 +384,9 @@ whatsapp
|
||||
wickrme
|
||||
wickrpro
|
||||
wireshark
|
||||
wordservice
|
||||
wwdc
|
||||
xeroxphaser7800
|
||||
xink
|
||||
xmenu
|
||||
xquartz
|
||||
yed
|
||||
yubikeymanagerqt
|
||||
|
||||
@@ -12,7 +12,7 @@ We have put a lot of work into making it stable and safe, but we cannot - of cou
|
||||
|
||||
## Authors
|
||||
|
||||
Intallomator was originally inspired by the download scripts from William Smith and Sander Schram, and created by:
|
||||
Intallomator was original inspired by the download scripts from William Smith and Sander Schram, and created by:
|
||||
Armin Briegel - @scriptingosx
|
||||
|
||||
Later on a few more contributers came on the project:
|
||||
|
||||
@@ -1,30 +1,35 @@
|
||||
# MARK: check minimal macOS requirement
|
||||
# MARK: 3 Arguments
|
||||
|
||||
# Start trapping the script
|
||||
trap_with_arg func_trap SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM SIGTSTP
|
||||
|
||||
# check minimal macOS requirement
|
||||
autoload is-at-least
|
||||
|
||||
installedOSversion=$(sw_vers -productVersion)
|
||||
if ! is-at-least 10.14 $installedOSversion; then
|
||||
printlog "Installomator requires at least macOS 10.14 Mojave." ERROR
|
||||
printlog "Installomator requires at least macOS 10.14 Mojave."
|
||||
exit 98
|
||||
fi
|
||||
|
||||
# MARK: argument parsing
|
||||
if [[ $# -eq 0 ]]; then
|
||||
if [[ -z $label ]]; then # check if label is set inside script
|
||||
printlog "no label provided, printing labels" REQ
|
||||
printlog "no label provided, printing labels"
|
||||
grep -E '^[a-z0-9\_-]*(\)|\|\\)$' "$0" | tr -d ')|\' | grep -v -E '^(broken.*|longversion|version|valuesfromarguments)$' | sort
|
||||
#grep -E '^[a-z0-9\_-]*(\)|\|\\)$' "${labelFile}" | tr -d ')|\' | grep -v -E '^(broken.*|longversion|version|valuesfromarguments)$' | sort
|
||||
exit 0
|
||||
fi
|
||||
elif [[ $1 == "/" ]]; then
|
||||
# jamf uses sends '/' as the first argument
|
||||
printlog "shifting arguments for Jamf" REQ
|
||||
printlog "shifting arguments for Jamf"
|
||||
shift 3
|
||||
fi
|
||||
|
||||
while [[ -n $1 ]]; do
|
||||
if [[ $1 =~ ".*\=.*" ]]; then
|
||||
# if an argument contains an = character, send it to eval
|
||||
printlog "setting variable from argument $1" WARN
|
||||
printlog "setting variable from argument $1"
|
||||
eval $1
|
||||
else
|
||||
# assume it's a label
|
||||
@@ -96,33 +101,33 @@ currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print
|
||||
# MARK: check for root
|
||||
if [[ "$(whoami)" != "root" && "$DEBUG" -eq 0 ]]; then
|
||||
# not running as root
|
||||
cleanupAndExit 6 "not running as root, exiting" ERROR
|
||||
cleanupAndExit 6 "not running as root, exiting"
|
||||
fi
|
||||
|
||||
# MARK: labels in case statement
|
||||
case $label in
|
||||
longversion)
|
||||
# print the script version
|
||||
printlog "Installomater: version $VERSION ($VERSIONDATE)" REQ
|
||||
printlog "Installomater: version $VERSION ($VERSIONDATE)"
|
||||
exit 0
|
||||
;;
|
||||
valuesfromarguments)
|
||||
if [[ -z $name ]]; then
|
||||
printlog "need to provide 'name'" ERROR
|
||||
printlog "need to provide 'name'"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z $type ]]; then
|
||||
printlog "need to provide 'type'" ERROR
|
||||
printlog "need to provide 'type'"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z $downloadURL ]]; then
|
||||
printlog "need to provide 'downloadURL'" ERROR
|
||||
printlog "need to provide 'downloadURL'"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z $expectedTeamID ]]; then
|
||||
printlog "need to provide 'expectedTeamID'" ERROR
|
||||
printlog "need to provide 'expectedTeamID'"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
# label descriptions start here
|
||||
# Mark: label descriptions start here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# MARK: Functions
|
||||
# MARK: 2 Functions
|
||||
|
||||
cleanupAndExit() { # $1 = exit code, $2 message, $3 level
|
||||
if [ -n "$dmgmount" ]; then
|
||||
@@ -18,10 +18,8 @@ cleanupAndExit() { # $1 = exit code, $2 message, $3 level
|
||||
reopenClosedProcess
|
||||
if [[ -n $2 && $1 -ne 0 ]]; then
|
||||
printlog "ERROR: $2" $3
|
||||
else
|
||||
printlog "$2" $3
|
||||
fi
|
||||
printlog "################## End Installomator, exit code $1 \n" REQ
|
||||
printlog "################## End Installomator, exit code $1 \n\n" REQ
|
||||
|
||||
# if label is wrong and we wanted name of the label, then return ##################
|
||||
if [[ $RETURN_LABEL_NAME -eq 1 ]]; then
|
||||
@@ -31,6 +29,17 @@ cleanupAndExit() { # $1 = exit code, $2 message, $3 level
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
# Two functions to trap the script
|
||||
trap_with_arg() {
|
||||
func="$1" ; shift
|
||||
for sig ; do
|
||||
trap "$func $sig" "$sig"
|
||||
done
|
||||
}
|
||||
func_trap() {
|
||||
cleanupAndExit 255 "Installomator has been terminated with: $1" ERROR
|
||||
}
|
||||
|
||||
runAsUser() {
|
||||
if [[ $currentUser != "loginwindow" ]]; then
|
||||
uid=$(id -u "$currentUser")
|
||||
@@ -99,7 +108,7 @@ printlog(){
|
||||
curl -s -X POST https://http-intake.logs.datadoghq.com/v1/input -H "Content-Type: text/plain" -H "DD-API-KEY: $datadogAPI" -d "${log_priority} : $mdmURL : Installomator-${label} : ${VERSIONDATE//-/} : $SESSION : ${logmessage}" > /dev/null
|
||||
done <<< "$log_message"
|
||||
fi
|
||||
|
||||
|
||||
# Extra spaces
|
||||
space_char=""
|
||||
if [[ ${#log_priority} -eq 3 ]]; then
|
||||
@@ -156,10 +165,10 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
|
||||
fi
|
||||
|
||||
if [ -n "$archiveName" ]; then
|
||||
downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
| awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }")
|
||||
else
|
||||
downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
| awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
|
||||
fi
|
||||
if [ -z "$downloadURL" ]; then
|
||||
@@ -176,9 +185,9 @@ versionFromGit() {
|
||||
gitusername=${1?:"no git user name"}
|
||||
gitreponame=${2?:"no git repo name"}
|
||||
|
||||
appNewVersion=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | grep tag_name | cut -d '"' -f 4 | sed 's/[^0-9\.]//g')
|
||||
appNewVersion=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | grep tag_name | cut -d '"' -f 4 | sed 's/[^0-9\.]//g')
|
||||
if [ -z "$appNewVersion" ]; then
|
||||
printlog "could not retrieve version number for $gitusername/$gitreponame" WARN
|
||||
printlog "could not retrieve version number for $gitusername/$gitreponame"
|
||||
appNewVersion=""
|
||||
else
|
||||
echo "$appNewVersion"
|
||||
@@ -222,34 +231,19 @@ getAppVersion() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# get app in targetDir, /Applications, or /Applications/Utilities
|
||||
if [[ -d "$targetDir/$appName" ]]; then
|
||||
applist="$targetDir/$appName"
|
||||
elif [[ -d "/Applications/$appName" ]]; then
|
||||
# get app in /Applications, or /Applications/Utilities, or find using Spotlight
|
||||
if [[ -d "/Applications/$appName" ]]; then
|
||||
applist="/Applications/$appName"
|
||||
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
|
||||
# targetDir="/Applications"
|
||||
# fi
|
||||
elif [[ -d "/Applications/Utilities/$appName" ]]; then
|
||||
applist="/Applications/Utilities/$appName"
|
||||
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
|
||||
# targetDir="/Applications/Utilities"
|
||||
# fi
|
||||
else
|
||||
# applist=$(mdfind "kind:application $appName" -0 )
|
||||
printlog "name: $name, appName: $appName"
|
||||
applist=$(mdfind "kind:application AND name:$name" -0 )
|
||||
# printlog "App(s) found: ${applist}" DEBUG
|
||||
# applist=$(mdfind "kind:application AND name:$appName" -0 )
|
||||
applist=$(mdfind "kind:application $appName" -0 )
|
||||
fi
|
||||
if [[ -z applist ]]; then
|
||||
printlog "No previous app found" INFO
|
||||
printlog "No previous app found" DEBUG
|
||||
else
|
||||
printlog "App(s) found: ${applist}" INFO
|
||||
printlog "App(s) found: ${applist}" DEBUG
|
||||
fi
|
||||
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
|
||||
# printlog "targetDir for installation: $targetDir" INFO
|
||||
# fi
|
||||
|
||||
appPathArray=( ${(0)applist} )
|
||||
|
||||
@@ -272,10 +266,10 @@ getAppVersion() {
|
||||
fi
|
||||
fi
|
||||
else
|
||||
printlog "could not determine location of $appName" WARN
|
||||
printlog "could not determine location of $appName"
|
||||
fi
|
||||
else
|
||||
printlog "could not find $appName" WARN
|
||||
printlog "could not find $appName"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -402,7 +396,7 @@ reopenClosedProcess() {
|
||||
processuser=$(ps aux | grep -i "${appName}" | grep -vi "grep" | awk '{print $1}')
|
||||
printlog "Reopened ${appName} as $processuser"
|
||||
else
|
||||
printlog "App not closed, so no reopen." INFO
|
||||
printlog "App not closed, so no reopen." DEBUG
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -412,7 +406,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
|
||||
# check if app exists
|
||||
if [ ! -e "$appPath" ]; then
|
||||
cleanupAndExit 8 "could not find: $appPath" ERROR
|
||||
cleanupAndExit 8 "could not find: $appPath" DEBUG
|
||||
fi
|
||||
|
||||
# verify with spctl
|
||||
@@ -425,13 +419,6 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
|
||||
if [[ $appVerifyStatus -ne 0 ]] ; then
|
||||
#if ! teamID=$(spctl -a -vv "$appPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then
|
||||
if [[ "$(echo $appVerify | head -1 | grep -oi rejected)" = "rejected" ]]; then
|
||||
if [[ "$(echo $appVerify | tail -1)" = "source=no usable signature" ]]; then
|
||||
printlog "Gatekeeper check rejected. No usable signature." ERROR
|
||||
else
|
||||
printlog "Gatekeeper check rejected. Could be that gatekeeper settings only accept App Store apps." ERROR
|
||||
fi
|
||||
fi
|
||||
cleanupAndExit 4 "Error verifying $appPath error:\n$logoutput" ERROR
|
||||
fi
|
||||
printlog "Debugging enabled, App Verification output was:\n$logoutput" DEBUG
|
||||
@@ -451,12 +438,10 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "No update for $name!"
|
||||
fi
|
||||
cleanupAndExit 0 "No new version to install" REG
|
||||
cleanupAndExit 0 "No new version to install" INFO
|
||||
else
|
||||
printlog "Using force to install anyway."
|
||||
fi
|
||||
elif [[ -z $appversion ]]; then
|
||||
printlog "Installing $name version $appNewVersion on versionKey $versionKey."
|
||||
else
|
||||
printlog "Downloaded version of $name is $appNewVersion on versionKey $versionKey (replacing version $appversion)."
|
||||
fi
|
||||
@@ -472,7 +457,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "Error updating $name!"
|
||||
fi
|
||||
cleanupAndExit 6 "Installed macOS is too old for this app." ERROR
|
||||
cleanupAndExit 6 "Installed macOS is too old for this app." INFO
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -493,7 +478,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
|
||||
# remove existing application
|
||||
if [ -e "$targetDir/$appName" ]; then
|
||||
printlog "Removing existing $targetDir/$appName" WARN
|
||||
printlog "Removing existing $targetDir/$appName" DEBUG
|
||||
deleteAppOut=$(rm -Rfv "$targetDir/$appName" 2>&1)
|
||||
tempName="$targetDir/$appName"
|
||||
tempNameLength=$((${#tempName} + 10))
|
||||
@@ -504,21 +489,16 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
|
||||
# copy app to /Applications
|
||||
printlog "Copy $appPath to $targetDir"
|
||||
copyAppOut=$(ditto -v "$appPath" "$targetDir/$appName" 2>&1)
|
||||
copyAppStatus=$(echo $?)
|
||||
deduplicatelogs "$copyAppOut"
|
||||
printlog "Debugging enabled, App copy output was:\n$logoutput" DEBUG
|
||||
if [[ $copyAppStatus -ne 0 ]] ; then
|
||||
#if ! ditto "$appPath" "$targetDir/$appName"; then
|
||||
cleanupAndExit 7 "Error while copying:\n$logoutput" ERROR
|
||||
if ! ditto "$appPath" "$targetDir/$appName"; then
|
||||
cleanupAndExit 7 "Error while copying" ERROR
|
||||
fi
|
||||
|
||||
# set ownership to current user
|
||||
if [[ "$currentUser" != "loginwindow" && $SYSTEMOWNER -ne 1 ]]; then
|
||||
printlog "Changing owner to $currentUser" WARN
|
||||
printlog "Changing owner to $currentUser"
|
||||
chown -R "$currentUser" "$targetDir/$appName"
|
||||
else
|
||||
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel" WARN
|
||||
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel"
|
||||
chown -R root:wheel "$targetDir/$appName"
|
||||
fi
|
||||
|
||||
@@ -548,7 +528,7 @@ mountDMG() {
|
||||
dmgmountStatus=$(echo $?)
|
||||
dmgmount=$(echo $dmgmountOut | tail -n 1 | cut -c 54- )
|
||||
deduplicatelogs "$dmgmountOut"
|
||||
|
||||
|
||||
if [[ $dmgmountStatus -ne 0 ]] ; then
|
||||
#if ! dmgmount=$(echo 'Y'$'\n' | hdiutil attach "$tmpDir/$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then
|
||||
cleanupAndExit 3 "Error mounting $tmpDir/$archiveName error:\n$logoutput" ERROR
|
||||
@@ -557,7 +537,7 @@ mountDMG() {
|
||||
cleanupAndExit 3 "Error accessing mountpoint for $tmpDir/$archiveName error:\n$logoutput" ERROR
|
||||
fi
|
||||
printlog "Debugging enabled, dmgmount output was:\n$logoutput" DEBUG
|
||||
|
||||
|
||||
printlog "Mounted: $dmgmount" INFO
|
||||
}
|
||||
|
||||
@@ -574,7 +554,7 @@ installFromPKG() {
|
||||
spctlOut=$(spctl -a -vv -t install "$archiveName" 2>&1 )
|
||||
spctlStatus=$(echo $?)
|
||||
printlog "spctlOut is $spctlOut" DEBUG
|
||||
|
||||
|
||||
teamID=$(echo $spctlOut | awk -F '(' '/origin=/ {print $2 }' | tr -d '()' )
|
||||
# Apple signed software has no teamID, grab entire origin instead
|
||||
if [[ -z $teamID ]]; then
|
||||
@@ -582,16 +562,9 @@ installFromPKG() {
|
||||
fi
|
||||
|
||||
deduplicatelogs "$spctlOut"
|
||||
|
||||
|
||||
if [[ $spctlStatus -ne 0 ]] ; then
|
||||
#if ! spctlout=$(spctl -a -vv -t install "$archiveName" 2>&1 ); then
|
||||
if [[ "$(echo $spctlOut | head -1 | grep -oi rejected)" = "rejected" ]]; then
|
||||
if [[ "$(echo $spctlOut | tail -1)" = "source=no usable signature" ]]; then
|
||||
printlog "Gatekeeper check rejected. No usable signature." ERROR
|
||||
else
|
||||
printlog "Gatekeeper check rejected. Could be that gatekeeper settings only accept App Store apps." ERROR
|
||||
fi
|
||||
fi
|
||||
cleanupAndExit 4 "Error verifying $archiveName error:\n$logoutput" ERROR
|
||||
fi
|
||||
|
||||
@@ -623,7 +596,7 @@ installFromPKG() {
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "No update for $name!"
|
||||
fi
|
||||
cleanupAndExit 0 "No new version to install" REQ
|
||||
cleanupAndExit 0 "No new version to install" INFO
|
||||
else
|
||||
printlog "Using force to install anyway."
|
||||
fi
|
||||
@@ -697,28 +670,27 @@ installPkgInDmg() {
|
||||
if [[ -z $pkgName ]]; then
|
||||
# find first file ending with 'pkg'
|
||||
findfiles=$(find "$dmgmount" -iname "*.pkg" -type f -maxdepth 1 )
|
||||
printlog "Found pkg(s):\n$findfiles" DEBUG
|
||||
filearray=( ${(f)findfiles} )
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" ERROR
|
||||
fi
|
||||
archiveName="${filearray[1]}"
|
||||
printlog "found pkg: $archiveName"
|
||||
else
|
||||
if [[ -s "$dmgmount/$pkgName" ]] ; then # was: $tmpDir
|
||||
archiveName="$dmgmount/$pkgName"
|
||||
if ls "$tmpDir/$pkgName" ; then
|
||||
archiveName="$tmpDir/$pkgName"
|
||||
else
|
||||
# try searching for pkg
|
||||
findfiles=$(find "$dmgmount" -iname "$pkgName") # was: $tmpDir
|
||||
printlog "Found pkg(s):\n$findfiles" DEBUG
|
||||
findfiles=$(find "$tmpDir" -iname "$pkgName")
|
||||
filearray=( ${(f)findfiles} )
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg “$pkgName” in dmg $archiveName" ERROR
|
||||
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName" ERROR
|
||||
fi
|
||||
# it is now safe to overwrite archiveName for installFromPKG
|
||||
archiveName="${filearray[1]}"
|
||||
printlog "found pkg: $archiveName"
|
||||
fi
|
||||
fi
|
||||
printlog "found pkg: $archiveName"
|
||||
|
||||
# installFromPkgs
|
||||
installFromPKG
|
||||
@@ -733,7 +705,6 @@ installPkgInZip() {
|
||||
if [[ -z $pkgName ]]; then
|
||||
# find first file ending with 'pkg'
|
||||
findfiles=$(find "$tmpDir" -iname "*.pkg" -type f -maxdepth 2 )
|
||||
printlog "Found pkg(s):\n$findfiles" DEBUG
|
||||
filearray=( ${(f)findfiles} )
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg in zip $archiveName" ERROR
|
||||
@@ -810,13 +781,13 @@ runUpdateTool() {
|
||||
printlog "Error running $updateTool, Procceding with normal installation. Exit Status: $updateStatus Error:\n$logoutput" WARN
|
||||
return 1
|
||||
if [[ $type == updateronly ]]; then
|
||||
cleanupAndExit 77 "No Download URL Set, this is an update only application and the updater failed" ERROR
|
||||
cleanupAndExit 77 "No Download URL Set, this is an update only application and the updater failed" WARN
|
||||
fi
|
||||
elif [[ $updateStatus -eq 0 ]]; then
|
||||
printlog "Debugging enabled, update tool output was:\n$logoutput" DEBUG
|
||||
fi
|
||||
else
|
||||
printlog "couldn't find $updateTool, continuing normally" WARN
|
||||
printlog "couldn't find $updateTool, continuing normally"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
@@ -833,7 +804,7 @@ finishing() {
|
||||
message="Installed $name, version $appversion"
|
||||
fi
|
||||
|
||||
printlog "$message" REQ
|
||||
printlog "$message"
|
||||
|
||||
if [[ $currentUser != "loginwindow" && ( $NOTIFY == "success" || $NOTIFY == "all" ) ]]; then
|
||||
printlog "notifying"
|
||||
|
||||
@@ -80,7 +80,6 @@ LOGO=appstore
|
||||
# - mosyleb Mosyle Business
|
||||
# - mosylem Mosyle Manager (Education)
|
||||
# - addigy Addigy
|
||||
# - microsoft Microsoft Endpoint Manager (Intune)
|
||||
# path can also be set in the command call, and if file exists, it will be used.
|
||||
# Like 'LOGO="/System/Applications/App\ Store.app/Contents/Resources/AppIcon.icns"'
|
||||
# (spaces have to be escaped).
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
1passwordcli)
|
||||
name="1Password CLI"
|
||||
type="pkg"
|
||||
#packageID="com.1password.op"
|
||||
downloadURL=$(curl -fs https://app-updates.agilebits.com/product_history/CLI | grep -m 1 -i op_apple_universal | cut -d'"' -f 2)
|
||||
appNewVersion=$(echo $downloadURL | sed -E 's/.*\/[a-zA-Z_]*([0-9.]*)\..*/\1/g')
|
||||
appCustomVersion(){ /usr/local/bin/op -v }
|
||||
expectedTeamID="2BUA8C4S2C"
|
||||
;;
|
||||
@@ -1,7 +0,0 @@
|
||||
amazoncorretto8jdk)
|
||||
name="Amazon Corretto 8 JDK"
|
||||
type="pkg"
|
||||
downloadURL="https://corretto.aws/downloads/latest/amazon-corretto-8-x64-macos-jdk.pkg"
|
||||
appNewVersion=$(curl -s https://raw.githubusercontent.com/corretto/corretto-8/develop/CHANGELOG.md | grep "## Corretto version" | head -n 1 | awk '{ print $4; exit}')
|
||||
expectedTeamID="94KV3E626L"
|
||||
;;
|
||||
@@ -1,7 +1,7 @@
|
||||
appcleaner)
|
||||
# credit: Tadayuki Onishi (@kenchan0130)
|
||||
name="AppCleaner"
|
||||
type="zip"
|
||||
downloadURL=$(curl -fs https://freemacsoft.net/appcleaner/Updates.xml | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | tr " " "\n" | sort | tail -1 | cut -d '"' -f 2)
|
||||
appNewVersion=$(curl -fsL "https://freemacsoft.net/appcleaner/Updates.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2)
|
||||
downloadURL=$(curl -fs https://freemacsoft.net/appcleaner/Updates.xml | xpath '//rss/channel/*/enclosure/@url' 2>/dev/null | tr " " "\n" | sort | tail -1 | cut -d '"' -f 2)
|
||||
expectedTeamID="X85ZX835W9"
|
||||
;;
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
autodeskfusion360admininstall)
|
||||
name="Autodesk Fusion 360 Admin Install"
|
||||
type="pkg"
|
||||
packageID="com.autodesk.edu.fusion360"
|
||||
downloadURL="https://dl.appstreaming.autodesk.com/production/installers/Autodesk%20Fusion%20360%20Admin%20Install.pkg"
|
||||
appNewVersion=$(curl -fs "https://dl.appstreaming.autodesk.com/production/97e6dd95735340d6ad6e222a520454db/73e72ada57b7480280f7a6f4a289729f/full.json" | sed -E 's/.*build-version":"([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+).*/\1/g')
|
||||
expectedTeamID="XXKJ396S2Y"
|
||||
appName="Autodesk Fusion 360.app"
|
||||
blockingProcesses=( "Autodesk Fusion 360" "Fusion 360" )
|
||||
;;
|
||||
@@ -1,14 +0,0 @@
|
||||
axurerp10)
|
||||
name="Axure RP 10"
|
||||
type="dmg"
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
downloadURL="https://d3uii9pxdigrx1.cloudfront.net/AxureRP-Setup-arm64.dmg"
|
||||
elif [[ $(arch) == "i386" ]]; then
|
||||
downloadURL="https://d3uii9pxdigrx1.cloudfront.net/AxureRP-Setup.dmg"
|
||||
fi
|
||||
appNewVersion=$( curl -sL https://www.axure.com/release-history | grep -Eo '[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}' -m 1 )
|
||||
expectedTeamID="HUMW6UU796"
|
||||
versionKey="CFBundleVersion"
|
||||
appName="Axure RP 10.app"
|
||||
blockingProcesses=( "Axure RP 10" )
|
||||
;;
|
||||
@@ -1,7 +0,0 @@
|
||||
calcservice)
|
||||
name="CalcService"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" "https://www.devontechnologies.com/support/download" | tr '"' "\n" | grep -o "http.*download.*.zip" | grep -i calcservice | head -1)"
|
||||
appNewVersion="$(echo $downloadURL | sed -E 's/.*\/([0-9.]*)\/.*/\1/g')"
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
@@ -1,7 +0,0 @@
|
||||
clipy)
|
||||
name="Clipy"
|
||||
type="dmg"
|
||||
downloadURL=$(downloadURLFromGit Clipy Clipy)
|
||||
appNewVersion=$(versionFromGit Clipy Clipy)
|
||||
expectedTeamID="BBCHAJ584H"
|
||||
;;
|
||||
@@ -1,9 +1,8 @@
|
||||
dialog|\
|
||||
swiftdialog)
|
||||
dialog)
|
||||
name="Dialog"
|
||||
type="pkg"
|
||||
packageID="au.csiro.dialogcli"
|
||||
downloadURL="$(downloadURLFromGit bartreardon swiftDialog)"
|
||||
appNewVersion="$(versionFromGit bartreardon swiftDialog)"
|
||||
downloadURL="$(downloadURLFromGit bartreardon Dialog)"
|
||||
appNewVersion="$(versionFromGit bartreardon Dialog)"
|
||||
expectedTeamID="PWA5E9TQ59"
|
||||
;;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
dockutil)
|
||||
name="dockutil"
|
||||
type="pkg"
|
||||
packageID="dockutil.cli.tool"
|
||||
downloadURL=$(downloadURLFromGit "kcrawford" "dockutil")
|
||||
appNewVersion=$(versionFromGit "kcrawford" "dockutil")
|
||||
expectedTeamID="Z5J8CJBUWC"
|
||||
blockingProcesses=( NONE )
|
||||
;;
|
||||
@@ -1,7 +0,0 @@
|
||||
easyfind)
|
||||
name="EasyFind"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs "https://www.devontechnologies.com/apps/freeware" | grep -o "http.*download.*.zip" | grep -i easyfind)"
|
||||
appNewVersion="$(echo $downloadURL | sed -E 's/.*\/([0-9.]*)\/.*/\1/g')"
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
@@ -1,7 +1,14 @@
|
||||
googlechrome)
|
||||
name="Google Chrome"
|
||||
type="dmg"
|
||||
downloadURL="https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg"
|
||||
appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac_arm64,stable/{print $3; exit}')
|
||||
if [[ $(arch) != "i386" ]]; then
|
||||
printlog "Architecture: arm64 (not i386)"
|
||||
downloadURL="https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg"
|
||||
appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac_arm64,stable/{print $3; exit}')
|
||||
else
|
||||
printlog "Architecture: i386"
|
||||
downloadURL="https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg"
|
||||
appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac,stable/{print $3; exit}')
|
||||
fi
|
||||
expectedTeamID="EQHXZ8M8AV"
|
||||
;;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
grammarly)
|
||||
name="Grammarly Desktop"
|
||||
type="dmg"
|
||||
packageID="com.grammarly.ProjectLlama"
|
||||
downloadURL=$(curl -fsL "https://download-mac.grammarly.com/appcast.xml" | xpath '//rss/channel/item[1]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2)
|
||||
expectedTeamID="W8F64X92K3"
|
||||
appNewVersion=$(curl -is "https://download-mac.grammarly.com/appcast.xml" | grep sparkle:version | tr ',' '\n' | grep sparkle:version | cut -d '"' -f 4)
|
||||
appName="Grammarly Installer.app"
|
||||
;;
|
||||
@@ -1,7 +0,0 @@
|
||||
houdahspot)
|
||||
name="HoudahSpot"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs https://www.houdah.com/houdahSpot/updates/cast6.php | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)"
|
||||
appNewVersion="$(curl -fs https://www.houdah.com/houdahSpot/updates/cast6.php | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)"
|
||||
expectedTeamID="DKGQD8H8ZY"
|
||||
;;
|
||||
@@ -2,11 +2,7 @@ loom)
|
||||
# credit: Lance Stephens (@pythoninthegrass on MacAdmins Slack)
|
||||
name="Loom"
|
||||
type="dmg"
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
downloadURL=https://cdn.loom.com/desktop-packages/$(curl -fs https://s3-us-west-2.amazonaws.com/loom.desktop.packages/loom-inc-production/desktop-packages/latest-mac.yml | awk '/url/ && /arm64/ && /dmg/ {print $3}' | head -1)
|
||||
elif [[ $(arch) == "i386" ]]; then
|
||||
downloadURL=https://cdn.loom.com/desktop-packages/$(curl -fs https://s3-us-west-2.amazonaws.com/loom.desktop.packages/loom-inc-production/desktop-packages/latest-mac.yml | awk '/url/ && /dmg/ {print $3}' | head -1)
|
||||
fi
|
||||
downloadURL=https://cdn.loom.com/desktop-packages/$(curl -fs https://s3-us-west-2.amazonaws.com/loom.desktop.packages/loom-inc-production/desktop-packages/latest-mac.yml | awk '/url/ && /dmg/ {print $3}' | head -1)
|
||||
appNewVersion=$(curl -fs https://s3-us-west-2.amazonaws.com/loom.desktop.packages/loom-inc-production/desktop-packages/latest-mac.yml | awk '/version/ {print $2}' )
|
||||
expectedTeamID="QGD2ZPXZZG"
|
||||
;;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
macadminspython)
|
||||
name="MacAdmins Python"
|
||||
type="pkg"
|
||||
packageID="org.macadmins.python.recommended"
|
||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/macadmins/python/releases/latest" | awk -F '"' "/browser_download_url/ && /python_recommended_signed/ { print \$4; exit }")
|
||||
appNewVersion=$(grep -o -E '\d+\.\d+\.\d+\.\d+' <<< $downloadURL | head -n 1)
|
||||
expectedTeamID="9GQZ7KUFR6"
|
||||
blockingProcesses=( NONE )
|
||||
;;
|
||||
@@ -1,10 +0,0 @@
|
||||
microsoftazuredatastudio|\
|
||||
azuredatastudio)
|
||||
name="Azure Data Studio"
|
||||
type="zip"
|
||||
downloadURL=$( curl -sL https://github.com/microsoft/azuredatastudio/releases/latest | grep 'macOS ZIP' | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" )
|
||||
appNewVersion=$(versionFromGit microsoft azuredatastudio )
|
||||
expectedTeamID="UBF8T346G9"
|
||||
appName="Azure Data Studio.app"
|
||||
blockingProcesses=( "Azure Data Studio" )
|
||||
;;
|
||||
@@ -1,6 +1,5 @@
|
||||
microsoftdefender|\
|
||||
microsoftdefenderatp)
|
||||
name="Microsoft Defender"
|
||||
name="Microsoft Defender ATP"
|
||||
type="pkg"
|
||||
downloadURL="https://go.microsoft.com/fwlink/?linkid=2097502"
|
||||
appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.defender.standalone"]/version' 2>/dev/null | sed -E 's/<version>([0-9.]*) .*/\1/')
|
||||
@@ -1,10 +1,9 @@
|
||||
supportapp)
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
name="Support"
|
||||
type="pkg"
|
||||
packageID="nl.root3.support"
|
||||
downloadURL=$(downloadURLFromGit root3nl SupportApp)
|
||||
appNewVersion=$(versionFromGit root3nl SupportApp)
|
||||
expectedTeamID="98LJ4XBGYK"
|
||||
uid=$(id -u "$currentUser")
|
||||
launchctl bootout gui/${uid} "/Library/LaunchAgents/nl.root3.support.plist"
|
||||
;;
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
tembo)
|
||||
name="Tembo"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs https://www.houdah.com/tembo/updates/cast2.xml | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)"
|
||||
appNewVersion="$(curl -fs https://www.houdah.com/tembo/updates/cast2.xml | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)"
|
||||
expectedTeamID="DKGQD8H8ZY"
|
||||
;;
|
||||
@@ -1,8 +0,0 @@
|
||||
wordservice)
|
||||
name="WordService"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" "https://www.devontechnologies.com/support/download" | tr '"' "\n" | grep -o "http.*download.*.zip" | grep -i wordservice | head -1)"
|
||||
appNewVersion="$(echo $downloadURL | sed -E 's/.*\/([0-9.]*)\/.*/\1/g')"
|
||||
appNewVersion=""
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
@@ -1,8 +0,0 @@
|
||||
xmenu)
|
||||
name="XMenu"
|
||||
type="zip"
|
||||
downloadURL="$(curl -fs "https://www.devontechnologies.com/apps/freeware" | grep -o "http.*download.*.zip" | grep -i xmenu)"
|
||||
appNewVersion="$(echo $downloadURL | sed -E 's/.*\/([0-9.]*)\/.*/\1/g')"
|
||||
expectedTeamID="679S2QUWR8"
|
||||
;;
|
||||
|
||||
@@ -4,5 +4,4 @@ zoom)
|
||||
downloadURL="https://zoom.us/client/latest/ZoomInstallerIT.pkg"
|
||||
appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5)"
|
||||
expectedTeamID="BJ4HAAB9B3"
|
||||
versionKey="CFBundleVersion"
|
||||
;;
|
||||
|
||||
@@ -4,5 +4,4 @@ zoomgov)
|
||||
downloadURL="https://www.zoomgov.com/client/latest/ZoomInstallerIT.pkg"
|
||||
appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5)"
|
||||
expectedTeamID="BJ4HAAB9B3"
|
||||
versionKey="CFBundleVersion"
|
||||
;;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
# Mark: 4 Main
|
||||
*)
|
||||
# unknown label
|
||||
#printlog "unknown label $label"
|
||||
cleanupAndExit 1 "unknown label $label" ERROR
|
||||
cleanupAndExit 1 "unknown label $label"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Are we only asked to return label name
|
||||
if [[ $RETURN_LABEL_NAME -eq 1 ]]; then
|
||||
printlog "Only returning label name." REQ
|
||||
printlog "Only returning label name."
|
||||
printlog "$name"
|
||||
echo "$name"
|
||||
exit
|
||||
@@ -18,7 +19,7 @@ fi
|
||||
if [[ ${INTERRUPT_DND} = "no" ]]; then
|
||||
# Check if a fullscreen app is active
|
||||
if hasDisplaySleepAssertion; then
|
||||
cleanupAndExit 1 "active display sleep assertion detected, aborting" ERROR
|
||||
cleanupAndExit 1 "active display sleep assertion detected, aborting"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -55,11 +56,6 @@ case $LOGO in
|
||||
LOGO="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
|
||||
if [[ -z $MDMProfileName ]]; then; MDMProfileName="MDM Profile"; fi
|
||||
;;
|
||||
microsoft)
|
||||
# Microsoft Endpoint Manager (Intune)
|
||||
LOGO="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
|
||||
if [[ -z $MDMProfileName ]]; then; MDMProfileName="Management Profile"; fi
|
||||
;;
|
||||
esac
|
||||
if [[ ! -a "${LOGO}" ]]; then
|
||||
if [[ $(sw_vers -buildVersion) > "19" ]]; then
|
||||
@@ -68,9 +64,9 @@ if [[ ! -a "${LOGO}" ]]; then
|
||||
LOGO="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
|
||||
fi
|
||||
fi
|
||||
printlog "LOGO=${LOGO}" INFO
|
||||
printlog "LOGO=${LOGO}"
|
||||
|
||||
printlog "Label type: $type" INFO
|
||||
printlog "Label type: $type"
|
||||
|
||||
# MARK: extract info from data
|
||||
if [ -z "$archiveName" ]; then
|
||||
@@ -92,7 +88,7 @@ if [ -z "$archiveName" ]; then
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
printlog "archiveName: $archiveName" INFO
|
||||
printlog "archiveName: $archiveName" DEBUG
|
||||
|
||||
if [ -z "$appName" ]; then
|
||||
# when not given derive from name
|
||||
@@ -110,13 +106,14 @@ if [ -z "$targetDir" ]; then
|
||||
updateronly)
|
||||
;;
|
||||
*)
|
||||
cleanupAndExit 99 "Cannot handle type $type" ERROR
|
||||
printlog "Cannot handle type $type"
|
||||
cleanupAndExit 99
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ -z $blockingProcesses ]]; then
|
||||
printlog "no blocking processes defined, using $name as default" INFO
|
||||
printlog "no blocking processes defined, using $name as default"
|
||||
blockingProcesses=( $name )
|
||||
fi
|
||||
|
||||
@@ -132,7 +129,8 @@ fi
|
||||
# MARK: change directory to temporary working directory
|
||||
printlog "Changing directory to $tmpDir" DEBUG
|
||||
if ! cd "$tmpDir"; then
|
||||
cleanupAndExit 1 "error changing directory $tmpDir" ERROR
|
||||
printlog "error changing directory $tmpDir"
|
||||
cleanupAndExit 1
|
||||
fi
|
||||
|
||||
# MARK: get installed version
|
||||
@@ -155,10 +153,10 @@ if [[ -n $appNewVersion ]]; then
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "No update for $name!"
|
||||
fi
|
||||
cleanupAndExit 0 "No newer version." REQ
|
||||
cleanupAndExit 0 "No newer version."
|
||||
fi
|
||||
else
|
||||
printlog "DEBUG mode 1 enabled, not exiting, but there is no new version of app." WARN
|
||||
printlog "DEBUG mode 1 enabled, not exiting, but there is no new version of app."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
@@ -171,12 +169,13 @@ if [[ (-n $appversion && -n "$updateTool") || "$type" == "updateronly" ]]; then
|
||||
if [[ $DEBUG -ne 1 ]]; then
|
||||
if runUpdateTool; then
|
||||
finishing
|
||||
cleanupAndExit 0 "updateTool has run" REQ
|
||||
cleanupAndExit 0
|
||||
elif [[ $type == "updateronly" ]];then
|
||||
cleanupAndExit 0 "type is $type so we end here." REQ
|
||||
printlog "type is $type so we end here."
|
||||
cleanupAndExit 0
|
||||
fi # otherwise continue
|
||||
else
|
||||
printlog "DEBUG mode 1 enabled, not running update tool" WARN
|
||||
printlog "DEBUG mode 1 enabled, not running update tool"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -199,14 +198,14 @@ else
|
||||
deduplicatelogs "$curlDownload"
|
||||
if [[ $curlDownloadStatus -ne 0 ]]; then
|
||||
#if ! curl --location --fail --silent "$downloadURL" -o "$archiveName"; then
|
||||
printlog "error downloading $downloadURL" ERROR
|
||||
printlog "error downloading $downloadURL"
|
||||
message="$name update/installation failed. This will be logged, so IT can follow up."
|
||||
if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then
|
||||
printlog "notifying"
|
||||
if [[ $updateDetected == "YES" ]]; then
|
||||
displaynotification "$message" "Error updating $name"
|
||||
displaynotification "$message" "Error updating $name" ERROR
|
||||
else
|
||||
displaynotification "$message" "Error installing $name"
|
||||
displaynotification "$message" "Error installing $name" ERROR
|
||||
fi
|
||||
fi
|
||||
printlog "File list: $(ls -lh "$archiveName")" ERROR
|
||||
@@ -271,7 +270,8 @@ case $type in
|
||||
installAppInDmgInZip
|
||||
;;
|
||||
*)
|
||||
cleanupAndExit 99 "Cannot handle type $type" ERROR
|
||||
printlog "Cannot handle type $type"
|
||||
cleanupAndExit 99
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -279,4 +279,4 @@ esac
|
||||
finishing
|
||||
|
||||
# all done!
|
||||
cleanupAndExit 0 "All done!" REQ
|
||||
cleanupAndExit 0
|
||||
|
||||
@@ -1 +1 @@
|
||||
10dev
|
||||
9.1beta
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
grammarly)
|
||||
name="Grammarly Desktop"
|
||||
type="dmg"
|
||||
packageID="com.grammarly.ProjectLlama"
|
||||
downloadURL=$(curl -fsL "https://download-mac.grammarly.com/appcast.xml" | xpath '//rss/channel/item[1]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2)
|
||||
expectedTeamID="W8F64X92K3"
|
||||
appNewVersion=$(curl -is "https://download-mac.grammarly.com/appcast.xml" | grep sparkle:version | tr ',' '\n' | grep sparkle:version | cut -d '"' -f 4)
|
||||
appName="Grammarly Installer.app"
|
||||
;;
|
||||
Reference in New Issue
Block a user