Skip to main content
Solved

Trying to add variable to jamfhelper description


Forum|alt.badge.img+17

I'm trying to create a popup message for users who are running low on boot drive space. I'm getting the free space of the boot volume and adding it to a description variable that I then call in the command to jamfhelper. But it doesn't work in jamfhelper (no description displayed)

1#!/bin/bash
2
3space=`diskutil info / | awk '/Free Space:/ {print $4 $5}'`
4title="Drive Space Warning"
5description="DNG has detected that your boot drive may almost be out of space! You only have $space free. Please contact DNG support if you need assistance freeing up space."
6
7jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
8icon="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertCautionIcon.icns"
9
10"$jamfHelper" -windowType utility -title "$title" -description "$MSG" -button1 "OK" -icon "$icon" -alignDescription center

Best answer by Chris

Not sure if it's just a typo, but your variable is called "description" and the jamfHelper command is looking for "$MSG"...

I would also look for a different way to get the free space.
Future versions of OS X *cough* might use different output of diskutil info, so your command might not work there.

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+13
  • Valued Contributor
  • 268 replies
  • Answer
  • August 19, 2016

Not sure if it's just a typo, but your variable is called "description" and the jamfHelper command is looking for "$MSG"...

I would also look for a different way to get the free space.
Future versions of OS X *cough* might use different output of diskutil info, so your command might not work there.


Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • 404 replies
  • August 19, 2016

Yep. That's what I get for working late. D'oh. >.<


Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • 404 replies
  • August 19, 2016

I haven't had a chance to test 10.12 yet... I guess I'll have to add an OS check in there.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings