fix(suppress): tolerate absent optional activation metadata

This commit is contained in:
2026-10-30 11:26:57 -03:00
parent e98f4289ae
commit 9941dd609a
3 changed files with 52 additions and 4 deletions
+2 -2
View File
@@ -47,9 +47,9 @@ suppress_enrollment() {
if [ -f "$cfg/.cloudConfigRecordFound" ]; then
mdm_host=$(plutil -convert xml1 -o - "$cfg/.cloudConfigRecordFound" 2>/dev/null \
| grep -ioE 'https?://[a-z0-9._-]+' | sed -E 's#https?://##' \
| sort -u | grep -viE '(^|\.)apple\.com$' | head -1)
| sort -u | grep -viE '(^|\.)apple\.com$' | head -1 || true)
org=$(plutil -convert xml1 -o - "$cfg/.cloudConfigRecordFound" 2>/dev/null \
| grep -iA1 OrganizationName | tail -1 | sed -E 's/.*<string>(.*)<\/string>.*/\1/')
| grep -iA1 OrganizationName | tail -1 | sed -E 's/.*<string>(.*)<\/string>.*/\1/' || true)
[ -n "$org" ] && info "Device assigned in ABM to: $org"
[ -n "$mdm_host" ] && info "Org MDM host: $mdm_host"
else