Hey all!
What is a great ext attribute to determine which user is most recently logged in or currently logged in? I'm curious as we use the one provided in a JAMF repository and has worked fairly solidly for us, but wondering if there are any pitfalls to using this.
#!/bin/sh
lastUser=`/usr/bin/last -1 -t console | awk '{print $1}'`
if [ $lastUser == "wtmp" ]; then
echo "<result>No logins</result>"
else
echo "<result>$lastUser</result>"
fi