Hi All
I'm trying to run a command to set a screen saver option as the current logged in user through a script but it's failing... I have tried looking around for ways to run as the local user instead of the root user used by Jamf and I can get it to add "/Library/Screen" the local user plist file but not the full location "/Library/Screen Savers/Default Collections/5 - Company", can any one shed some light on where i'm going wrong, I'm going square eyed looking at this over and over
My script is:
!/bin/bash
currentuser=$(/bin/ls -la /dev/console | /usr/bin/cut -d ' ' -f 4)
su -l $currentuser -c "defaults write /Users/$currentuser/Library/Preferences/com.apple.ScreenSaverPhotoChooser SelectedFolderPath '/Library/Screen Savers/Default Collections/5 - Company'"
Any help is very much appreciated....