xref: /freebsd/usr.sbin/periodic/etc/weekly/340.noid (revision a25896ca1270e25b657ceaa8d47d5699515f5c25)
1#!/bin/sh -
2#
3# $FreeBSD$
4#
5
6# If there is a global system configuration file, suck it in.
7#
8if [ -r /etc/defaults/periodic.conf ]
9then
10    . /etc/defaults/periodic.conf
11    source_periodic_confs
12fi
13
14case "$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;;
27esac
28
29exit $rc
30