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