SH Script to set screensaver within 2 Hours + Require Password

I tried following: https://macmule.com/2010/11/19/how-to-set-osxs-screen-saver-via-script/

I need to be able to push out the script via our mac management tool, which I have done many other SH files with no issue, including adding printers, etc. We do not have fancy Jam F, since its out of the budget at the moment.

Including: MIKE Thank you!! FWIW although this post is old, I spent some time trying to set a corporate screensaver, and out of all the different methods (plist, defaults, mobileconfig) this was the only one I could get to work. I did have success with this on 10.11 and 10.12. The only thing I had to do was remove lines 110 and 115. I assume those two were needed on older OS versions, but it was breaking it for me.

Settings:

startTime="60" 			# Integer - Seconds
justMain="0"			# Boolean
screenSaverName="Shell"		# String
screenSaverPath="/System/Library/Screen Savers/Shell.saver"	 # String
requirePassword="1"		# Integer (1 = true, 0 = false)
timeBeforeRequiringPassword=“1”	# Integer - Seconds
askforpassword="1" # Integer (1 = true, 0 = false)

Note: for testing I just made it 60 seconds.

Bashing the script in terminal outputs:

File Doesn't Exist, Will Create: /Users/(my username)/Library/Preferences/ByHost/com.apple.screensaver.4588884F-85AB-59FC-9A6D-C20249A7E9F4.plist
/Users/(my username)/Desktop/setscreensavertest1.sh: line 135: unexpected EOF while looking for matching `"'
/Users/(my username)/Desktop/setscreensavertest1.sh: line 140: syntax error: unexpected end of file

Link to SH file via Google Drive

I appreciate all the help I can get.

Posted Mar 12, 2018, 8:56 PM UTC

10
Loading comments…