Make sure that the input of "uniq -d" is sorted to avoid that duplicate UID's and hosts entries are missed.

This commit is contained in:
SiemKorteweg 2015-10-06 20:02:33 +02:00
parent bf1da50c14
commit b7d24c3413
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@
fi
# Check password file
if [ -f ${PASSWD_FILE} ]; then
FIND=`cat ${PASSWD_FILE} | grep -v '^#' | cut -d ':' -f3 | uniq -d`
FIND=`cat ${PASSWD_FILE} | grep -v '^#' | cut -d ':' -f3 | sort | uniq -d`
if [ "${FIND}" = "" ]; then
Display --indent 2 --text "- Checking for non-unique UIDs" --result OK --color GREEN
logtext "Result: all accounts found in ${PASSWD_FILE} are unique"

View File

@ -588,7 +588,7 @@
if [ ${SKIPTEST} -eq 0 ]; then
logtext "Test: check duplicate line in /etc/hosts"
if [ -f /etc/hosts ]; then
sFIND=`cat /etc/hosts | egrep -v '^(#|$)' | uniq -d`
sFIND=`cat /etc/hosts | egrep -v '^(#|$)' | sort | uniq -d`
if [ "${sFIND}" = "" ]; then
logtext "Result: OK, no duplicate lines found"
Display --indent 4 --text "- Checking /etc/hosts (duplicates)" --result OK --color GREEN