diff --git a/MDM/Jamf Pro/service-status-ea.sh b/MDM/Jamf Pro/service-status-ea.sh old mode 100644 new mode 100755 index e0b96ab..cab4454 --- a/MDM/Jamf Pro/service-status-ea.sh +++ b/MDM/Jamf Pro/service-status-ea.sh @@ -5,9 +5,19 @@ outsetStatusRaw=$(/usr/local/outset/outset --service-status) enabledDaemons=$(echo $outsetStatusRaw | grep -c 'Enabled$') +# If there is no user logged in, none of the 3 agents will be active, only the daemons. + +expectedServices=6 + +currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' ) + +if [ -z "$currentUser" -o "$currentUser" = "loginwindow" ]; then + expectedServices=3 +fi + healthyStatus="Not Healthy" -if [ $enabledDaemons -eq 6 ]; then +if [ $enabledDaemons -eq $expectedServices ]; then healthyStatus="Healthy" fi