Found a script to check if a user is signed in to the Box client app on Mac. The script is successful when run locally on the device, but there’s an issue when run remotely from hexnode. I’m guessing the user variable in the script isn’t fetching the currently logged in user like it would when run locally from the mac.
This is the script:
#!/bin/sh
if [ -f /Users/$loggedInUser/Library/Preferences/com.box.desktop.plist ]; then
loggedin=$(defaults read /Users/$loggedInUser/Library/Preferences/com.box.desktop preferences/user_is_currently_logged_in)
echo “<result>$loggedin</result>”
else
echo “<result>File Not Found</result>”
fi
You guys got any ideas?