Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion macOS/Config/Bootstrap Token/fixBootstrapToken.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function print_status {
}

# Check if the boostrap token was ever escrowed. If not, stop early as success.
if echo "profiles status -type bootstraptoken" | grep -q "Bootstrap Token escrowed to server: NO"; then
if profiles status -type bootstraptoken 2>&1 | grep -q "Bootstrap Token escrowed to server: NO"; then
exit 0
fi

Expand All @@ -50,6 +50,9 @@ if cat "$logdir/checkBootstrapEscrow.log" | grep -q "Bootstrap Token validated."
exit 0
fi

# Check secure token status for the admin account
SECURE_TOKEN_STATUS=$(sysadminctl -secureTokenStatus "$ADMIN_USERNAME" 2>&1)

# Fail early if the account provided does not have secure token enabled
if echo "$SECURE_TOKEN_STATUS" | grep -q "Secure token is DISABLED"; then
echo "$(date) | Secure token is disabled for $ADMIN_USERNAME. Not proceeding."
Expand Down
Loading