File: USERS

package info (click to toggle)
cruft-ng 0.9.78
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,904 kB
  • sloc: cpp: 1,748; sh: 816; python: 262; makefile: 97; ansic: 82; perl: 75
file content (36 lines) | stat: -rwxr-xr-x 531 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
set -e

test -z "$CRUFT_ROOT" || exit 0

set -u

if test -e "/var/mail/root"
then
	echo "/var/mail/root"
fi

if test -e "/var/spool/cron/crontabs/root"
then
	echo "/var/spool/cron/crontabs/root"
fi

awk -F: '{ if ( 1000 <= $3 && $3 < 30000 ) print $1 " " $6}' /etc/passwd | while read -r user home
do
	if test -d "$home"
	then
		echo "$home"
	fi

	if test -e "/var/mail/$user"
	then
		echo "/var/mail/$user"
	fi

	if test -e "/var/spool/cron/crontabs/$user"
	then
		echo "/var/spool/cron/crontabs/$user"
	fi
done

exit 0