cryptonas/debian/postinst

26 lines
717 B
Plaintext
Raw Normal View History

#!/bin/sh
2006-11-10 10:05:14 +01:00
LOG_FILE=/var/log/cryptobox.log
CRYPTOBOX_USER=cryptobox
2005-12-13 03:27:33 +01:00
2006-11-10 10:05:14 +01:00
# create mount and config directories with appropriate permissions
test ! -e "$LOG_FILE" && mkdir -p "$(dirname $LOG_FILE)" && touch "$LOG_FILE" && chown "$CRYPTOBOX_USER" "$LOG_FILE"
2005-12-13 03:27:33 +01:00
if getent passwd "$CRYPTOBOX_USER" 2>/dev/null >/dev/null
then # do nothing - the user already exists
true
else # create cryptobox user
echo "Creating new user '$CRYPTOBOX_USER' ..."
2006-11-10 10:05:14 +01:00
USER_HOME=/var/cache/cryptobox
adduser --system --group --home "$USER_HOME" cryptobox
mkdir "$USER_HOME/mnt"
chown -R ${CRYPTOBOX_USER}: "$USER_HOME"
# only members of the cryptobox group may access the user directory
chmod 750 "$USER_HOME"
fi
2006-05-30 21:00:34 +02:00
#DEBHELPER#
2005-12-01 20:20:36 +01:00
true