Skip to main content
Solved

Trying to add variable to jamfhelper description

  • August 19, 2016
  • 3 replies
  • 25 views

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)

#!/bin/bash

space=`diskutil info / | awk '/Free Space:/ {print $4 $5}'`
title="Drive Space Warning"
description="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."

jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
icon="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertCautionIcon.icns"

"$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.

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.