This "nightly" script runs every night :
Code: Select all
:global found
/system script run monthend
:if ([$found] = true) do={ /system script run resetcount ; :log info "Automatic EOM Usermanager counter reset"}
:if ([$found] = false) do={ /system script run usagewarnings ; :log info "Usage Warning Script triggered" }
Code: Select all
:local date
:local day
:local month
:local year
:local yeardiv
:local yearmult
:local leapyear
:local lastday
:global found
:set date [system clock get date]
:set month [:pick $date 0 3]
:set day [:pick $date 4 6]
:set year [:pick $date 7 11]
:set yeardiv ($year / 4)
:set yearmult ($yeardiv * 4)
:if ([$yearmult] = $year) do={ :set leapyear true } else={ :set leapyear false }
:if ([$month] = jan) do={ :set lastday 31 }
:if ([$month] = feb) do={
:if ($leapyear = true) do={ :set lastday 29 }
:if ($leapyear = false) do={ :set lastday 28 } }
:if ([$month] = mar) do={ :set lastday 31 }
:if ([$month] = apr) do={ :set lastday 30 }
:if ([$month] = may) do={ :set lastday 31 }
:if ([$month] = jun) do={ :set lastday 30 }
:if ([$month] = jul) do={ :set lastday 31 }
:if ([$month] = aug) do={ :set lastday 31 }
:if ([$month] = sep) do={ :set lastday 30 }
:if ([$month] = oct) do={ :set lastday 31 }
:if ([$month] = nov) do={ :set lastday 30 }
:if ([$month] = dec) do={ :set lastday 31 }
:if ([$lastday] = $day) do={ :set found true } else={ :set found false }
I know this was noted to work on v3 betas, can someone direct me to how to alter this script for 2.9?
Cheers