Merge pull request #5995 from tuky/patch-1

Respect configured JELLYFIN_USER in Debian's postinst
pull/6038/head
Joshua M. Boniface 4 years ago committed by GitHub
commit 6f3bd59aac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

12
debian/postinst vendored

@ -9,6 +9,8 @@ if [[ -f $DEFAULT_FILE ]]; then
. $DEFAULT_FILE . $DEFAULT_FILE
fi fi
JELLYFIN_USER=${JELLYFIN_USER:-jellyfin}
# Data directories for program data (cache, db), configs, and logs # Data directories for program data (cache, db), configs, and logs
PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME} PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME}
CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME} CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME}
@ -18,12 +20,12 @@ CACHEDATA=${JELLYFIN_CACHE_DIRECTORY-/var/cache/$NAME}
case "$1" in case "$1" in
configure) configure)
# create jellyfin group if it does not exist # create jellyfin group if it does not exist
if [[ -z "$(getent group jellyfin)" ]]; then if [[ -z "$(getent group ${JELLYFIN_USER})" ]]; then
addgroup --quiet --system jellyfin > /dev/null 2>&1 addgroup --quiet --system ${JELLYFIN_USER} > /dev/null 2>&1
fi fi
# create jellyfin user if it does not exist # create jellyfin user if it does not exist
if [[ -z "$(getent passwd jellyfin)" ]]; then if [[ -z "$(getent passwd ${JELLYFIN_USER})" ]]; then
adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \ adduser --system --ingroup ${JELLYFIN_USER} --shell /bin/false ${JELLYFIN_USER} --no-create-home --home ${PROGRAMDATA} \
--gecos "Jellyfin default user" > /dev/null 2>&1 --gecos "Jellyfin default user" > /dev/null 2>&1
fi fi
# ensure $PROGRAMDATA exists # ensure $PROGRAMDATA exists
@ -43,7 +45,7 @@ case "$1" in
mkdir $CACHEDATA mkdir $CACHEDATA
fi fi
# Ensure permissions are correct on all config directories # Ensure permissions are correct on all config directories
chown -R jellyfin $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA chown -R ${JELLYFIN_USER} $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA
chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA chgrp adm $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA
chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA chmod 0750 $PROGRAMDATA $CONFIGDATA $LOGDATA $CACHEDATA

Loading…
Cancel
Save