lbrycrd/contrib/debian/bitcoind.postinst

28 lines
550 B
Text
Raw Normal View History

#!/bin/sh
# setup bitcoin account, homedir etc
set -e
BCUSER="bitcoin"
BCHOME="/var/lib/bitcoin"
if [ "$1" = "configure" ]; then
# Add bitcoin user/group - this will gracefully abort if the user already exists.
# A homedir is never created.
adduser --system --home "${BCHOME}" --no-create-home --group "${BCUSER}"
# 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