123456789101112131415
  1. #!/bin/bash
  2. if [ -f "/etc/login.def" ];then
  3. RESULT=$(sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/login.defs | grep PASS_MIN_DAYS)
  4. if [ $? -eq 0 ];then
  5. if [ "$(echo $RESULT | awk '{printf $2}')" -lt "1" ];then
  6. exit 1
  7. fi
  8. else
  9. exit 1
  10. fi
  11. else
  12. exit 1
  13. fi