freedombonee/tests/check-password-min-len.sh

16 lines
390 B
Bash
Raw Normal View History

#!/bin/bash
if [ -f "/etc/login.def" ];then
RESULT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/login.defs | grep PASS_MIN_LEN)
if [ $? -eq 0 ];then
if [ "$(echo $RESULT | awk '{printf $2}')" -lt "14" ];then
exit 1
fi
else
exit 1
fi
else
exit 1
fi