spec: remove /etc/fstab from setup package
[platform/upstream/setup.git] / uidgidlint
1 #!/bin/sh
2 # We need a file to look at.
3 if [ -z "$*" ] ; then
4         echo Usage: `basename $0` uidgid
5         exit 1
6 fi
7 error=0
8 # The format of the file is (currently)
9 for infile in "$@" ; do
10         uidlist=`tail -n +2 "$infile" | awk '{print $2}' | grep -v '?' | grep -v -e - | sort -nu`
11         gidlist=`tail -n +2 "$infile" | awk '{print $3}' | grep -v '?' | grep -v -e - | sort -nu`
12         for uid in $uidlist ; do
13                 if test `tail -n +2 "$infile" | awk '{print $2}' | grep '^'"$uid"'$' | wc -l` -ne 1 ; then
14                         echo Duplicate UID: $uid
15                         error=1
16                 fi
17         done
18         for gid in $gidlist ; do
19                 if test `tail -n +2 "$infile" | awk '{print $3}' | grep '^'"$gid"'$' | wc -l` -ne 1 ; then
20                         echo Duplicate GID: $gid
21                         error=1
22                 fi
23         done
24 done
25 exit $error