Installing Updates At Logout With Lock Screen: Alan Benedict's script

Not applicable

Original script/description is quoted below-

we're very interested in using a lock script such as the one offered by Alan Benedict- So- we made some very minor changes to the script - ie, a different path variable for the images folder
Pushed the image resources to the test machine and set up a basic install policy w/ this script running as before and a large install as the package and thus far we get:

Script Exit Code:0 Script Result: /private/tmp/testlockscreen.sh: line 54: /Library/ApplicationSupport/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper: No such file or directory

The install does complete but obviously no lock screen- and I did check the path on the target Mac:

/Library/ApplicationSupport/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper
to see if it was valid- and yes, it is.

If it matters we are running Casper 8.1 Test unit is running 10.6.7.

I might be doing something completely stupid here, but any advice would be very much appreciated!

-Steve Bartoo

***
Quote:

8 REPLIES 8

Not applicable

I changed the iconpath variable slightly to:

iconpath="/Library/ITResources/HelperImages/"

That path exists on the target Mac, populated with 4 .pngs using the same .png image names as in the original script

maint.png
new.png
updt.png
hello.png

What I have is currently:
#!/bin/bash
# JamfHelper Screen Lock
# Alan Benedict - Integer Midwest
# Varibles
lastreboot=`uptime | awk '{print "Your last reboot was: " $3 " " $4 }' |
sed -e 's/.$//g'`
heading="$4" # This shows up above the image in a bigger bolder font than the description field
image="$5" # Options are as follows [ maintenance | new | update | hello ]
#each give you a diffrerent image to give the user better feedback of what is
#happening on their system
description="$lastreboot ago. $6" # This shows up below the image in a
#smaller lighter font than the heading field
iconpath="$7"

# Default description if none is passed through the variable
if [ "$4" == "" ]; then
heading="Installing Updates"
fi

if [ "$5" == "" ]; then
image="update"
fi

if [ "$6" == "" ]; then description="$lastreboot hello"
fi

if [ "$7" == "" ]; then
iconpath="/Library/ITResources/HelperImages/"
fi

# Case statement to assign specific graphic.
case $image in
maintenance )
icon="maint.png" ;;
new )
icon="new.png" ;;
update )
icon="updt.png" ;;
hello ) #just for kicks and giggles ;)
icon="hello.png" ;;
esac

bentoms
Release Candidate Programs Tester

The path looks wrong.

Shouldn't it be

/Library/Applic

Regards,

Ben.

bentoms
Release Candidate Programs Tester

Sorry. I meant.

/Library/Application Support/

Or

/Library/Application Support/

Regards,

Ben.

Not applicable

That's what the log Casper spits out:
/Library/ApplicationSupport/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper: No such file or directory

That's why the logs reference it as : /ApplicationSupport/

but in the script itself the path to jamfhelper is correct:

# Script contents
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs -icon "$iconpath$icon" -heading "$heading" -description "$description" &

stevewood
Honored Contributor II
Honored Contributor II

I don't think that error is referring to the path to jamfHelper, but to the
On Wed, Jul 20, 2011 at 1:36 PM, Steve Bartoo <Steve.Bartoo at macys.com>wrote:
path for the icon. Did you change the path for the icon in the script? I'm
assuming you're using Alan's script verbatim, and if that is the case, you
need to edit this line further up in the script:

iconpath="/Library/IT Resources/HelperImages/"

You need to set that path to somewhere on your machine where you have some
images you want to display. Alan's script uses images that we pre-popluate
during imaging time to make the lock screen look prettier.

You can also edit the call to jamfHelper and remove the -icon switch all
together:

/Library/Application
Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs
-heading "$heading" -description "$description" &

That would work and keep you from having to edit the iconpath variable or
putting images on the machines ahead of time.

Steve Wood
Director of IT
swood at integer.com

The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475

Not applicable

OK- the text only version suggested by Steve Wood does in fact work as expected- Thanks! I'd like the prettified version, but the text only is a huge help.

Obviously my scripting isn't the best, but I am really really certain that my:
iconpath="path to .pngs"
corresponds correctly to the folder structure on the target Mac, and is populated with the as-named .png files-

I presume the issue is here somewhere:
# Case statement to assign specific graphic.
case $image in
maintenance )
icon="maint.png" ;; new )
icon="new.png" ;;
update )
icon="updt.png" ;;
hello ) #just for kicks and giggles ;)
icon="hello.png" ;;
esac

Again, thanks for all your help, it is very much appreciated!

stevewood
Honored Contributor II
Honored Contributor II

If you only have need for one image, say a company logo or something, then
On Wed, Jul 20, 2011 at 4:32 PM, Steve Bartoo <Steve.Bartoo at macys.com>wrote:
you could take the case statement out and the iconpath variable and simply
hard code the image into the jamfHelper statement. Something like this
might work:

#!/bin/bash
# JamfHelper Screen Lock
# Customized by yours truly... ABenedict :)
# Varibles
lastreboot=`uptime | awk '{print "Your last reboot was: " $3 " " $4 }' |
sed -e 's/.$//g'`
heading="$4" # This shows up above the image in a bigger bolder font than
the description field
description="$lastreboot ago. $5" # This shows up below the image in a
smaller lighter font than the heading field

# Default description if none is passed through the variable
if [ "$4" == "" ]; then
heading="Installing Updates"
fi

if [ "$5" == "" ]; then
description="$lastreboot ago. Please do not close your laptop or unplug
anything until this screen disappears. Feel free to call the help desk if
this screen does not go away after 5 minutes."
fi

# Script contents
/Library/Application
Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs
-icon "/Library/ITResources/HelperImages/logo.png" -heading "$heading"
-description "$description" &

exit 0

Notice the change to the jamfHelper call and the hard coded "logo.png" file. Even creating a test directory just to make sure it works, like
"/test/logo.png" or something.

Glad the text only version worked for you. Good luck getting the rest to
work.

Steve Wood
Director of IT
swood at integer.com

The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475

Not applicable

This worked very well, and again, thank you!