freedomboneeee/tests/check-password-warn-age.sh

16 lines
390 B
Bash

#!/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_WARN_AGE)
if [ $? -eq 0 ];then
if [ "$(echo $RESULT | awk '{printf $2}')" -lt "7" ];then
exit 1
fi
else
exit 1
fi
else
exit 1
fi