diff --git a/CHANGELOG.md b/CHANGELOG.md index 29b7d73..1f34c98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - If your MDM is not Jamf Pro, and you need the script to be installed locally on your managed machines, then take a look at [Theiles fork](https://github.com/Theile/Installomator/). This fork can be called from the MDM using a small script. - Script `buildCaseStatement.sh` to help with creating labels have been improved. - Fixed a bug in a variable name that prevented updateTool to be used +- added `type` variable for value `"updateronly"` if the label should only run an updater tool. ## v0.4 - 2020-10-19 diff --git a/Installomator.sh b/Installomator.sh index 9700199..83defc4 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -90,6 +90,7 @@ INSTALL="" # - pkgInDmg # - pkgInZip # - appInDmgInZip +# - updateronly This last one is for labels that should only run an updateTool (see below) # # - packageID: (optional) # The package ID of a pkg @@ -3088,6 +3089,8 @@ if [ -z "$archiveName" ]; then *InZip) archiveName="${name}.zip" ;; + updateronly) + ;; *) printlog "Cannot handle type $type" cleanupAndExit 99 @@ -3108,6 +3111,8 @@ if [ -z "$targetDir" ]; then pkg*) targetDir="/" ;; + updateronly) + ;; *) printlog "Cannot handle type $type" cleanupAndExit 99 @@ -3133,19 +3138,21 @@ fi printlog "Changing directory to $tmpDir" if ! cd "$tmpDir"; then printlog "error changing directory $tmpDir" - #rm -Rf "$tmpDir" cleanupAndExit 1 fi # MARK: check if this is an Update and we can use updateTool getAppVersion printlog "appversion: $appversion" -if [[ -n $appversion && -n "$updateTool" ]]; then +if [[ (-n $appversion && -n "$updateTool") || "$type" == "updateronly" ]]; then printlog "appversion & updateTool" if [[ $DEBUG -eq 0 ]]; then if runUpdateTool; then finishing cleanupAndExit 0 + elif [[ $type == "updateronly" ]];then + printlog "type is $type so we end here." + cleanupAndExit 0 fi # otherwise continue else printlog "DEBUG mode enabled, not running update tool"