Skip to content

Commit 5e63512

Browse files
authored
feat(cli): add Find My Mac check to prevent script execution (#15)
Added a check for Find My Mac token in NVRAM to prevent script execution if it's active. <!-- Provide a general summary of your changes in the Title above --> ## Description Added a check for Find My Mac token in NVRAM to prevent script execution if it's active. ## Motivation and Context A Mac cannot be added to ABM if Find My Mac is active - it will fail and potentially cause data loss on a Mac as it automatically reverts to a deactivated state (losing the SecureTokens and Volume Ownership - as they are tied to a Mac's activation state) when attempting to add the Mac to ABM. ## How has this been tested? Real life hardship. ## Are there any related PR? No ## Types of changes The change attempts to check if Find My Mac is active in the NVRAM and will abort the script with warning before any damage can be done.
1 parent 48f539a commit 5e63512

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

add2abm.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ esac
3636

3737
# PREREQUISITES: ———————————————————————————————————————————————————————————————————————————————————
3838

39+
# Check for Find My Mac (FMM) Token in NVRAM:
40+
if nvram -p | grep -q "fmm-mobileme-token-proxy"; then
41+
printf '\n[!] ERROR: Find My Mac is currently ACTIVE on this device.\n'
42+
printf ' Please disable Find My Mac in System Settings before running this script.\n'
43+
exit 1
44+
fi
45+
3946
DB_PATH="/Volumes/Macintosh HD/var/db"
4047
ASD_FILE="${DB_PATH}/.AppleSetupDone"
4148
USERS_PATH="${DB_PATH}/dslocal/nodes/Default/users"

0 commit comments

Comments
 (0)