Trying to add variable to jamfhelper description

cwaldrip
Valued Contributor

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
1 ACCEPTED SOLUTION

Chris
Valued Contributor

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 solution in original post

3 REPLIES 3

Chris
Valued Contributor

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 solution in original post

cwaldrip
Valued Contributor

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

cwaldrip
Valued Contributor

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