8 CONFIG_DIR="/etc/$NAME"
9 MANAGE_SCRIPT="/usr/bin/$NAME-manage"
14 # make sure the administrative user exists
15 if ! getent passwd $USER >/dev/null; then
16 adduser --disabled-password --quiet --system \
17 --no-create-home --home /var/lib/$NAME \
18 --gecos "$NAME user" --group $USER
19 # add to audio group as required for stamina, it can be removed if
20 # not necessary and won't be automatically added back.
23 # ensure dirs ownership
24 chown $USER:$GROUP /var/log/$NAME
25 chown $USER:$GROUP /var/log/stamina
26 chown $USER:$GROUP /var/lib/$NAME/media
27 chown $USER:$GROUP /var/lib/$NAME/static
28 # create a secret file
29 SECRET_FILE=$CONFIG_DIR/secret
30 if [ ! -f $SECRET_FILE ]; then
31 echo -n "Generating Django secret..." >&2
32 cat /dev/urandom | tr -dc [:alnum:]-_\!\%\^:\; | head -c70 > $SECRET_FILE
33 chown root:$GROUP $SECRET_FILE
34 chmod 0440 $SECRET_FILE
38 abort-upgrade|abort-remove|abort-deconfigure|triggered)
42 echo "postinst called with unknown argument \`$1'" >&2