Skip to content

Commit

Permalink
Update Debian packaging to use the new configuration directories
Browse files Browse the repository at this point in the history
This updates the Debian packaging to use the new configuration
directories introduced by
#1535 and
#1538.  Instead of being
in /home/hts/.hts/tvheadend, the configuration will now be stored in
/var/lib/tvheadend by default, which is consistent with how many
other "server"-style Debian packages handle their home directories
and configuration.
  • Loading branch information
mamarley authored and Flole998 committed Jun 23, 2023
1 parent 612b615 commit 9958c34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions debian/tvheadend.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ configure)

if ! getent passwd $HTS_USER >/dev/null; then
echo >&2 "Creating user: $HTS_USER..."
adduser --quiet --system --group --shell /bin/bash $HTS_USER
adduser --quiet --system --group --home /var/lib/tvheadend $HTS_USER
fi

HTS_HOME=`getent passwd $HTS_USER | cut -d':' -f6`

mkdir -p "${HTS_HOME}/.hts/tvheadend"
chown ${HTS_USER}:${HTS_USER} "${HTS_HOME}/.hts"
chown ${HTS_USER}:${HTS_USER} "${HTS_HOME}/.hts/tvheadend"
install -d -g ${HTS_USER} -o ${HTS_USER} "${HTS_HOME}/recordings"

HTS_SUPERUSERCONF="${HTS_HOME}/.hts/tvheadend/superuser"
HTS_SUPERUSERCONF="${HTS_HOME}/superuser"
rm -f "${HTS_SUPERUSERCONF}"
touch "${HTS_SUPERUSERCONF}"
chmod 600 "${HTS_SUPERUSERCONF}"
Expand Down
2 changes: 1 addition & 1 deletion debian/tvheadend.postrm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ case "$1" in
purge)
if getent passwd $HTS_USER >/dev/null; then
HTS_HOME=`getent passwd $HTS_USER | cut -d':' -f6`
rm -rf "${HTS_HOME}/.hts/tvheadend"
rm -rf "${HTS_HOME}"
fi
db_purge
;;
Expand Down

0 comments on commit 9958c34

Please sign in to comment.