linux-bench/cfg/2.0.0/6.2.15.sh
2019-09-11 13:09:01 +03:00

8 lines
No EOL
223 B
Bash

#!/bin/bash
for i in $(cut -s -d: -f4 /etc/passwd | sort -u ); do
grep -q -P "^.*?:[^:]*:$i:" /etc/group
if [ $? -ne 0 ]; then
echo "Group $i is referenced by /etc/passwd but does not exist in /etc/group"
fi
done