OSXCasperScripts
OSXCasperScripts copied to clipboard
There is no console user active - 10.11.4 El Cap
Lachlan first off thanks so much for this script! It's working great. I am though, having an issue with a few select El Capitan users. When the check for current console user is done, there are 2 users returned, one being "_mbsetupuser" and the other being the actual user that is logged in.
consoleuser="$(ls -l /dev/console | awk '{print $3}')"
Because of this, it then fails the statement:
if [ "$(checkConsoleStatus)" == "userloggedin" ]
And returns, "Script result: there is no console user active, consolestatus: loginwindow..."
I stumbled upon a JAMF Nation Post that had a similar issue and the solution was to change the code for the console user to be:
ls -l /dev/console | cut -d " " -f4
This actually works! But alas, I am not very good at coding and I am hoping that you can confirm that this is a good solution and share with me how the code would look to grab the console user and use it in the rest of the script.
Thank you!