Find if Mac is managed (#73)

This commit is contained in:
enggnr 2023-08-01 12:18:36 +05:30 committed by GitHub
parent c391a28f22
commit 1fcc141ee4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,7 +89,13 @@
{{- if stdinIsATTY -}} {{- if stdinIsATTY -}}
{{- if not (env "WORK_ENVIRONMENT") -}} {{- if (eq .chezmoi.os "darwin") -}}
{{- if (contains "managed Mac computers" (output "/usr/libexec/ApplicationFirewall/socketfilterfw" "--getglobalstate")) -}}
{{- $work = true -}}
{{- else }}
{{- $work = false -}}
{{- end -}}
{{- else if not (env "WORK_ENVIRONMENT") -}}
{{- $work = promptBoolOnce $data.host "work" "Work environment" $work -}} {{- $work = promptBoolOnce $data.host "work" "Work environment" $work -}}
{{- end -}} {{- end -}}
{{- if not (env "RESTRICTED_ENVIRONMENT") -}} {{- if not (env "RESTRICTED_ENVIRONMENT") -}}