| 1 | #!/bin/sh |
| 2 | |
| 3 | # the code in this file will define the YEAR4D macro to the current |
| 4 | # year in 4 digits |
| 5 | # In January, a regexp will be generated that matches both the current |
| 6 | # year and the previous year. This should prevent aide reports to be |
| 7 | # generated on the New Year. It is assumed that the aide database will |
| 8 | # be regenerated at least once in January. |
| 9 | |
| 10 | if [ "$(date +%m)" = "01" ]; then |
| 11 | printf "@@define YEAR4D (%s|%s)\\n" "$(date +%Y)" "$(date +%Y --date='last year')" |
| 12 | else |
| 13 | printf "@@define YEAR4D %s\\n" "$(date +%Y)" |
| 14 | fi |
| 15 | |
| 16 | printf "@@define LASTYEAR4D %s\\n" "$(date +%Y --date='last year')" |
| 17 |