You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Mac-Health-Check.zsh
+22-8Lines changed: 22 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -397,6 +397,7 @@ allowedUptimeMinutes="10080"
397
397
maxUptimeMinutes="43200"
398
398
399
399
# Should excessive uptime result in a "warning" or "error" ?
400
+
# Setting this to error will disable the max uptime check above
400
401
excessiveUptimeAlertStyle="warning"
401
402
402
403
# Completion Timer (in seconds)
@@ -6634,31 +6635,44 @@ function checkUptime() {
6634
6635
else
6635
6636
uptimeHumanReadable="${uptimeNumber} (HH:MM)"
6636
6637
fi
6638
+
6639
+
if [[ "${maxUptimeMinutes}"=~'^[1-9][0-9]*$' ]];then
6640
+
if [[ "${allowedUptimeMinutes}"-gt"${maxUptimeMinutes}" ]];then
6641
+
warning "${humanReadableCheckName}: Error in configuration: Variable allowedUptimeMinutes is greater than maxUptimeMinutes. Maximum uptime check disabled."
warning "${humanReadableCheckName}: Error in configuration: Variable excessiveUptimeAlertStyle is set to error instead of warning. Maximum uptime check disabled."
6645
+
maxUptimeMinutes=""
6646
+
fi
6647
+
else
6648
+
warning "${humanReadableCheckName}: Error in configuration: Variable maxUptimeMinutes is not a postive integer. Maximum uptime check disabled."
6649
+
maxUptimeMinutes=""
6650
+
fi
6637
6651
6638
-
if [[ "${upTimeMin}"-gt"${maxUptimeMinutes}" ]] && [[ -n"${maxUptimeMinutes}" ]];then
6639
-
uptimeExtendedStatus="Your Mac's uptime is beyond the maximum 30 days allowed."
6652
+
if [[ -n"${maxUptimeMinutes}" ]] && [[ "${upTimeMin}"-gt"${maxUptimeMinutes}" ]];then
6653
+
localuptimeExtendedStatus="Your Mac's uptime is beyond the maximum allowed by your organization."
0 commit comments