| 1 | #!/bin/sh |
| 2 | |
| 3 | # Skip if systemd is running. |
| 4 | if [ -d /run/systemd/system ]; then |
| 5 | exit 0 |
| 6 | fi |
| 7 | |
| 8 | SCRIPT="/usr/share/aide/bin/dailyaidecheck" |
| 9 | if [ -x "${SCRIPT}" ]; then |
| 10 | if command -v capsh >/dev/null; then |
| 11 | capsh --caps="cap_dac_read_search,cap_audit_write+eip cap_setpcap,cap_setuid,cap_setgid+ep" --keep=1 --user=_aide --addamb=cap_dac_read_search,cap_audit_write -- -c "${SCRIPT} --crondaily" |
| 12 | else |
| 13 | # no capsh present, run with full capabilities |
| 14 | "${SCRIPT}" --crondaily |
| 15 | fi |
| 16 | fi |
| 17 | |
| 18 |