debmaker/ressources/paperless-ngx/rootfs/DEBIAN/postinst

16 lines
416 B
Bash
Executable File

#!/bin/bash
APP=paperless-ngx
HOMEDIR=/var/lib/paperless-ngx
LOGDIR=/var/log/paperless-ngx
CACHEDIR=/var/cache/paperless-ngx
[ -d ${HOMEDIR} ] || mkdir -p ${HOMEDIR}
id ${APP} &> /dev/null || useradd ${APP} -r -s /bin/false -d ${HOMEDIR}
chown ${APP}:${APP} ${HOMEDIR}
[ -d ${LOGDIR} ] || mkdir -p ${LOGDIR}
chown ${APP}:${APP} ${LOGDIR}
[ -d ${CACHEDIR} ] || mkdir -p ${CACHEDIR}
chown ${APP}:${APP} ${CACHEDIR}