Files
agrarian/contrib/debian/agrariand.postinst
T
2022-02-03 23:45:47 -08:00

29 lines
581 B
Plaintext

#!/bin/sh
# setup agrarian account, homedir etc
set -e
BCUSER="agrarian"
BCHOME="/var/lib/agrarian"
if [ "$1" = "configure" ]; then
# Add agrarian user/group - this will gracefully abort if the user already exists.
# A homedir is never created.
set +e
adduser --system --home "${BCHOME}" --no-create-home --group "${BCUSER}" 2>/dev/null
set -e
# If the homedir does not already exist, create it with proper
# ownership and permissions.
if [ ! -d "${BCHOME}" ]; then
mkdir -m 0750 -p "${BCHOME}"
chown "${BCUSER}:${BCUSER}" "${BCHOME}"
fi
fi
#DEBHELPER#
exit 0