blob: fe7c80b640f0d1dea9571b59a789f7a50d63f605 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
_bc_user=flowee
_bc_group=flowee
post_install() {
_mkuser
_dir="/var/lib/flowee"
_log="/var/log/flowee"
_cnf="/etc/flowee"
if test ! -d "$_dir"; then
mkdir -m 750 "$_dir"
fi
mkdir -p -m 750 "$_log"
chown -R $_bc_user:$_bc_group "$_dir" "$_cnf" "$_log"
}
post_upgrade() {
_mkuser
}
# ------------------------------------------------------------------------------
# helper functions for creating flowee user / group
# ------------------------------------------------------------------------------
_mkuser() {
getent passwd $_bc_user &>/dev/null || {
echo -n "Creating flowee user... "
grep -E "^$_bc_group:" /etc/group >/dev/null || groupadd $_bc_group
useradd -r -m -d /etc/flowee -g $_bc_group -s /usr/bin/nologin $_bc_user 2>/dev/null
echo "done"
}
}
|