Mac-Nerd / patchomator

Management script for Installomator.
Apache License 2.0
106 stars 9 forks source link

Adding initial managed config file support #24

Closed Ci7rix closed 3 months ago

Ci7rix commented 4 months ago

As discussed here : https://macadmins.slack.com/archives/C04V0BC98PQ/p1712157866087659 I added initial support for managed config files to my fork of Patchomator. The parameter that can be managed are "IgnoredLabels" and "RequiredLabels".

  1. For now, the easiest way to create a config profile is by using the command : defaults write /path/to/patchomator.plist IgnoredLabels/RequiredLabels -array label1 label2 label3
  2. And convert this plist file to a profile with https://github.com/scriptingosx/swift-prefs/.
  3. It can then be deployed by any MDM that support custom profiles.

I also wrote a Profile manifest for ProfileCreator and iMazing Profile Editor to create this config profile. I'll create a pull request for it if you want to merge this pull request.

If a configfile already exists, nothing will change, it will always be loaded first. I also added a way to prevent the managedConfigfile to be overwritten, as this is not desired with a profile.