Hey guys, newbie in this and myself and JAMF been trying to get the following to work but we are not getting much luck. Any thoughts?
#!/bin/bash
USER=$(ls -l /dev/console | awk '{print $3}')
DIRECTORY="/Users/$USER/Desktop/OneDrive - Bunbury Catheral Grammar School"
if [ ! -d "$DIRECTORY" ]; then
echo "<result>Not Present</result>"
else
echo "<result>Directory Exists</result>"
fi
It seems to not finding the directory itself as no matter what, the outcome is Directory Exist even when its not.
The OneDrive folder is located in the User Directory. Macintosh HD/User/username/Desktop
