periodic: Sync with FreeBSD current
[dragonfly.git] / etc / periodic / weekly / 340.noid
1 #!/bin/sh -
2 #
3 # $FreeBSD: head/etc/periodic/weekly/340.noid 220048 2011-03-27 03:03:29Z dougb $
4 #
5
6 # If there is a global system configuration file, suck it in.
7 #
8 if [ -r /etc/defaults/periodic.conf ]
9 then
10     . /etc/defaults/periodic.conf
11     source_periodic_confs
12 fi
13
14 case "$weekly_noid_enable" in
15     [Yy][Ee][Ss])
16         echo ""
17         echo "Check for files with an unknown user or group:"
18
19         rc=$(find -H ${weekly_noid_dirs:-/} \
20             \( ! -fstype local -prune -or -name \* \) -and \
21             \( -nogroup -o -nouser \) -print | sed 's/^/  /' |
22             tee /dev/stderr | wc -l)
23         [ $rc -gt 1 ] && rc=1
24         ;;
25
26     *)  rc=0;;
27 esac
28
29 exit $rc