Created
November 5, 2025 18:46
-
-
Save smashism/c2eb02613de4a3c75d0331642d594591 to your computer and use it in GitHub Desktop.
Gets the latest line from the OktaVerify.log and displays it on a Jamf Pro computer record when configured as an Extension Attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Extension attribute to read in last line of Okta Verify log file | |
| # Get the local user account | |
| currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' ) | |
| # Okta Verify log file | |
| oktaLogs="/Users/${currentUser}/Library/Group Containers/B7F62B65BN.group.okta.macverify.shared/Logs/OktaVerify.log" | |
| if [ -f "$oktaLogs" ] | |
| then | |
| /bin/echo "<result>$(/usr/bin/tail -n -1 "$oktaLogs")</result>" | |
| else | |
| /bin/echo "<result></result>" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment