From 2daea6d9fe5939f159d3bf0bc107418e328dedab Mon Sep 17 00:00:00 2001 From: Purple Date: Wed, 12 Feb 2025 16:26:53 +0000 Subject: [PATCH] fixed config profile matching check for config and auth --- Mac/Flight Checks/tailscale.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mac/Flight Checks/tailscale.sh b/Mac/Flight Checks/tailscale.sh index 6b41b52..4d8da51 100755 --- a/Mac/Flight Checks/tailscale.sh +++ b/Mac/Flight Checks/tailscale.sh @@ -96,7 +96,7 @@ check_auth_profile() { #echo "Auth Profile Present" # Check the configuration profile for the auth key local profile_check - profile_check=$(profiles -P | grep -A5 "com.purplecomputing.mdm.tailscale.authkey" | grep "io.tailscale.ipn") + profile_check=$(profiles show -type configuration -output stdout-xml | xmllint --format - | grep -A100 "com.purplecomputing.mdm.tailscale.authkey" | grep -A2 "PayloadType" | awk 'NR==2' | sed -E 's#(.*)#\1#' | sed 's/^[ \t]*//') if [[ -z "$profile_check" ]]; then echo "Error: No Tailscale identifier found in the configuration profile." @@ -130,7 +130,7 @@ check_config_profile() { #echo "Config Profile Present" # Check the configuration profile for the auth key local profile_check - profile_check=$(profiles -P | grep -A5 "com.purplecomputing.mdm.tailscale" | grep "io.tailscale.ipn") + profile_check=$(profiles show -type configuration -output stdout-xml | xmllint --format - | grep -A100 "com.purplecomputing.mdm.tailscale" | grep -A2 "VPNSubType" | awk 'NR==2' | sed -E 's#(.*)#\1#' | sed 's/^[ \t]*//') if [[ -z "$profile_check" ]]; then echo "Error: No Tailscale identifier found in the configuration profile."