Hotfix to postinst to correct permissions

Without this, if not importing a previous config, the perms are
broken on the config directories. Fixes this.
This commit is contained in:
Joshua Boniface 2019-01-06 15:02:28 -05:00
parent 1273da5af9
commit 7bee88280c

21
debian/postinst vendored
View File

@ -25,21 +25,22 @@ case "$1" in
adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \ adduser --system --ingroup jellyfin --shell /bin/false jellyfin --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 has appropriate permissions # ensure $PROGRAMDATA exists
if [[ ! -d $PROGRAMDATA ]]; then if [[ ! -d $PROGRAMDATA ]]; then
mkdir $PROGRAMDATA mkdir $PROGRAMDATA
chown -R jellyfin:jellyfin $PROGRAMDATA
fi fi
# ensure $JELLYFIN_CONFIG_DIRECTORY has appropriate permissions # ensure $CONFIGDATA exists
if [[ -n $JELLYFIN_CONFIG_DIRECTORY && ! -d $JELLYFIN_CONFIG_DIRECTORY ]]; then if [[ ! -d $CONFIGDATA ]]; then
mkdir $JELLYFIN_CONFIG_DIRECTORY mkdir $CONFIGDATA
chown -R jellyfin:jellyfin $JELLYFIN_CONFIG_DIRECTORY
fi fi
# ensure $JELLYFIN_LOG_DIRECTORY has appropriate permissions # ensure $LOGDATA exists
if [[ -n $JELLYFIN_LOG_DIRECTORY && ! -d $JELLYFIN_LOG_DIRECTORY ]]; then if [[ ! -d $LOGDATA ]]; then
mkdir $JELLYFIN_LOG_DIRECTORY mkdir $LOGDATA
chown -R jellyfin:jellyfin $JELLYFIN_LOG_DIRECTORY
fi fi
# Ensure permissions are correct on all config directories
chown -R jellyfin:jellyfin $PROGRAMDATA
chown -R jellyfin:jellyfin $CONFIGDATA
chown -R jellyfin:jellyfin $LOGDATA
chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true chmod +x /usr/lib/jellyfin/restart.sh > /dev/null 2>&1 || true