r1
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
|
||||
#!/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
|
||||
Reference in New Issue
Block a user