From ca7841e997ecf8e4cc44344e7447cdc20118d747 Mon Sep 17 00:00:00 2001 From: Chase Lau Date: Tue, 25 Aug 2026 21:14:27 -0500 Subject: [PATCH] Fix issue with head and logging in downloadEntraPhoto.sh Improper -1 in head doesn't work on macOS, so token retrieval was failing. Also, logging was leaking into the UPN, so graph queries were failing. --- macOS/Config/M365 Profile Photo Sync/downloadEntraPhoto.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macOS/Config/M365 Profile Photo Sync/downloadEntraPhoto.sh b/macOS/Config/M365 Profile Photo Sync/downloadEntraPhoto.sh index 19078ae..eb2a082 100755 --- a/macOS/Config/M365 Profile Photo Sync/downloadEntraPhoto.sh +++ b/macOS/Config/M365 Profile Photo Sync/downloadEntraPhoto.sh @@ -81,7 +81,7 @@ trap cleanup EXIT INT TERM # Function to log messages with consistent timestamp format log_message() { - echo "$(date '+%Y-%m-%d %H:%M:%S') | $1" + echo "$(date '+%Y-%m-%d %H:%M:%S') | $1" >&2 } # Function to log errors to stderr @@ -213,7 +213,7 @@ get_access_token() { # Extract HTTP code and body local http_code=$(echo "${response}" | tail -n1) - local body=$(echo "${response}" | head -n-1) + local body=$(echo "${response}" | sed '$d') # Extract token from response local token