fix(profiles): keep preflight queries read-only and numeric
This commit is contained in:
+2
-1
@@ -44,7 +44,8 @@ run_preformat_check() {
|
||||
step "Checking installed profiles..."
|
||||
if command -v profiles &>/dev/null; then
|
||||
local profile_count
|
||||
profile_count=$(sudo profiles -C -output=xml 2>/dev/null | grep -c "ProfileDisplayName" || echo 0)
|
||||
profile_count=$(sudo profiles -C -output stdout-xml 2>/dev/null | grep -c "ProfileDisplayName" || true)
|
||||
profile_count="${profile_count:-0}"
|
||||
if [ "$profile_count" -gt 0 ]; then
|
||||
echo -e " ${YEL}$profile_count profile(s) installed${NC}"
|
||||
clean=false
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ harden_live_os() {
|
||||
step "Removing residual MDM profiles..."
|
||||
if command -v profiles &>/dev/null; then
|
||||
local installed
|
||||
installed=$(profiles -C -output=xml 2>/dev/null | grep -c "ProfileDisplayName" || true)
|
||||
installed=$(profiles -C -output stdout-xml 2>/dev/null | grep -c "ProfileDisplayName" || true)
|
||||
if [ "$installed" -gt 0 ]; then
|
||||
if sudo profiles -D -F 2>/dev/null; then
|
||||
success "Forced profile removal"
|
||||
|
||||
Reference in New Issue
Block a user