super icon indicating copy to clipboard operation
super copied to clipboard

Feature Request: Jamf EA with "Deferral available until"

Open vonderboi opened this issue 2 years ago • 5 comments

I think this would be helpful to determine why a computer might not be updated yet.

vonderboi avatar Jul 19 '23 13:07 vonderboi

What type of deadlines are you setting?

The only type of deadline I can see this even being relevant for is a days-based deadline.

Macjutsu avatar Jul 19 '23 14:07 Macjutsu

Yes, I use the Hard Days as a deadline so depending on when the Jamf policy executes we will have different deadlines. I don't like to use a hard date because if say someone just came back from vacation I don't want them powering on their computer at 8:50 AM expecting to join a 9:00 AM meeting and have it automatically start any updating process.

vonderboi avatar Jul 19 '23 15:07 vonderboi

I guess I could just use the ZeroDayAuto date and time from the plist and mentally do the math.

vonderboi avatar Jul 19 '23 15:07 vonderboi

Yes... but this is a good idea.

Macjutsu avatar Jul 19 '23 21:07 Macjutsu

I just tweaked one of your EA for now (I'm not great at scripting):

#!/bin/bash

# Path to a local property list file:
superPLIST="/Library/Management/super/com.macjutsu.super" # No trailing ".plist"

# Report if the file exists.
if [[ -f "$superPLIST.plist" ]]; then
	superZero=$(defaults read "$superPLIST" ZeroDayAuto)
	# Report if the file has a value.
	if [[ -n $superZero ]]; then
        superHardDays=$(defaults read "$superPLIST" HardDays)
        superZeroDate=$(date -j -v +${superHardDays}d -f "%Y-%m-%d" "${superZero}" +%Y-%m-%d)
        superZeroTime=$(echo $superZero | cut -d':' -f2,3)
        echo "<result>$superZeroDate - $superZeroTime</result>"
	else
		echo "<result>No Zero Date Deadline deferrals.</result>"
	fi
else
	echo "<result>No super preference file.</result>"
fi

exit 0

vonderboi avatar Jul 20 '23 15:07 vonderboi