set -e
# Add a user to own the password history database.
-if ! getent passwd _history >/dev/null ; then
+if ! getent passwd _history >/dev/null; then
echo 'Adding system user for password history' 1>&2
adduser --disabled-login --quiet --system --no-create-home \
--home /var/lib/heimdal-history --force-badname --group _history
fi
# Create the directory for the history database, owned by the history user.
-if [ ! -d /var/lib/heimdal-history ] ; then
+if [ ! -d /var/lib/heimdal-history ]; then
mkdir /var/lib/heimdal-history
chown _history:_history /var/lib/heimdal-history
fi
# Purge the password history database and remove the _history user and group
# on package purge. This user should not be used for any other purpose.
-if [ "$1" = purge ] ; then
- for file in history.db history.db.lock lengths.db lengths.db.lock ; do
+if [ "$1" = purge ]; then
+ for file in history.db history.db.lock lengths.db lengths.db.lock; do
rm -f "/var/lib/heimdal-history/$file"
done
deluser --quiet --system _history >/dev/null || true
fi
# Remove the directory for the password history database on remove if empty.
-if [ "$1" = purge ] || [ "$1" = remove ] ; then
- if [ -d /var/lib/heimdal-history ] ; then
+if [ "$1" = purge ] || [ "$1" = remove ]; then
+ if [ -d /var/lib/heimdal-history ]; then
rmdir --ignore-fail-on-non-empty /var/lib/heimdal-history
fi
fi