5 kx #!/bin/sh
5 kx # update-cracklib - Regenerate cracklib word lists
5 kx #
5 kx # This script is based on the original cron job written by Jean Pierre
5 kx # LeJacq <jplejacq@quoininc.com>.
5 kx
5 kx set -e
5 kx
5 kx umask 0022
5 kx
5 kx if [ -r "/etc/cracklib/cracklib.conf" ] ; then
5 kx . /etc/cracklib/cracklib.conf
5 kx else
5 kx echo "ERROR: cannot read configuration file /etc/cracklib/cracklib.conf"
5 kx exit 1
5 kx fi
5 kx
5 kx if [ ! -d /var/cache/cracklib/ ] ; then
5 kx install -d -m 755 /var/cache/cracklib/
5 kx fi
5 kx
5 kx if [ -n "${cracklib_dictpath_src}" -a -n "${cracklib_dictpath}" ] ; then
5 kx export LC_COLLATE=C
5 kx updated=0
5 kx for i in ${cracklib_dictpath_src} ; do
5 kx if ! [ -e /var/cache/cracklib/src-dicts ] || \
5 kx ! grep -q "$i" /var/cache/cracklib/src-dicts || \
5 kx ! [ -e "${cracklib_dictpath}.pwd" ] || \
5 kx [ "$i" -nt "${cracklib_dictpath}.pwd" ] ; then
5 kx if [ $updated = 0 ] ; then
5 kx /usr/sbin/cracklib-format ${cracklib_dictpath_src} | /usr/sbin/cracklib-packer
5 kx updated=1
5 kx echo "${cracklib_dictpath_src}" > /var/cache/cracklib/src-dicts
5 kx fi
5 kx fi
5 kx done
5 kx fi
5 kx
5 kx exit 0