Macjutsu / super

S.U.P.E.R.M.A.N. optimizes the macOS software update experience.
Apache License 2.0
605 stars 82 forks source link

Feature Request: Jamf EA with "Deferral available until" #110

Open vonderboi opened 1 year ago

vonderboi commented 1 year ago

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

Macjutsu commented 1 year ago

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.

vonderboi commented 1 year ago

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 commented 1 year ago

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

Macjutsu commented 1 year ago

Yes... but this is a good idea.

vonderboi commented 1 year ago

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