Add appCustomVersion Checks#32
Conversation
Add checks for the appCustomVersion function in the Installomator labels to check if an app is installed. Also add a check for plugins to bypass appVerify since plugins do not require a signature unlike apps.
Update the script to check for signatures of a plugin instead of bypass all checks on a plugin. Also fix the installmode check and make a few more things quiet when the quiet flag is used.
Update some logic to check if a command line arguments were accidentally passed twice instead of just once. Also update the displayconfig at the end to still show when running in quiet mode unless the write flag was also set.
Added Log rolling if file is greater than 1 MB by default. Also set the maximum number of rolled files to 5 by default. These 5 files start at Patchomator.log.1 and go to Patchomator.log.5 for the oldest logs before getting purged. Cleaned up some logging and exiting code to make things consistent.
|
Added some log rolling and some logic updates as well to the script. |
Fixed the caffexit call to the finishAndExit function.
Added a check for if the --install and --write arguments are passed together and if so, default to the --install without overwriting the config file with a blank file.
Removed the extra finished output on an install, as well as changed the errors output to infoOut in order to honor quiet mode.
|
These are great. Working on reviewing/merging. |
|
For .plugin (and other future non-app updates) does |
Mac-Nerd
left a comment
There was a problem hiding this comment.
Can't remove this "finished" line - it's from a user request for something they can search on to check if the script is still running, or stuck.
| infoOut "\t${BOLD}Skipping.${RESET}" | ||
| return | ||
| else | ||
| echo -n "${BOLD}Replace label ${exists} with $foundLabel? ${YELLOW}[y/N]${RESET} " |
There was a problem hiding this comment.
if the [y/N] questions don't echo in quiet mode, then the script will hang waiting for an answer on the read, right? Also, I want to avoid things like FirefoxIntl automatically replacing Firefox.
Mac-Nerd
left a comment
There was a problem hiding this comment.
Thanks. This is much cleaner for command-line option parsing.
|
I believe that all of the finished statements still happen, they are just now all put in a function so that they can maintain consistency if you ever want to change the verbage or add something else after everything is finished, but before the script completes. I do see the problem with the question on the do you want to replace the label, so I will change that one back to an echo instead of going to infoOut. The --everywhere still won't look at anything put .app files since the search is searching for $appName. I didn't want to change that function without more time to delve into if that would work with other file extensions. I will make the changes and then commit again. |
Mac-Nerd
left a comment
There was a problem hiding this comment.
Note to self: Should check to see if the system log-rolling can be configured to include Patchomator.log so it can comply with whatever MDM or user-defined preferences.
Fixed the echo for the question of whether or not to update the found label. Changed some if statements to use an interger check instead of -eq 1 in case the command line argument was added twice.
|
FYI - if you're on Macadmins Slack, I'm @option8. DM me. |
Fixed the variable in interactive mode that added the last label in the list to the array instead of the current label that is being processed.
Add checks for the appCustomVersion function in the Installomator labels to check if an app is installed, with a fallback to the pkgutil check if an app location was not found in the appCustomVersion.
Add a check for .plugin since plugins like JRE8 do not require a signature unlike a .app. This checks the files inside the {PluginPath}Contents/Home/Bin folder for their TeamID.
Fix the installmode bug that caused the script to always run in install mode.
Quiet some lines if the script is run in quiet mode.