aboutsummaryrefslogtreecommitdiff
path: root/debian/postinst
diff options
context:
space:
mode:
authorJoshua Boniface <joshua@boniface.me>2018-12-09 16:41:49 -0500
committerJoshua Boniface <joshua@boniface.me>2018-12-09 19:05:33 -0500
commita9a798f81a836e31a8b82eab19558d9b95e7a63f (patch)
tree668e5c59203803e7dd25c149d00dcab80151d4c9 /debian/postinst
parentc8c35864fe5dbf5027a2d1e682abd72654d309e8 (diff)
Rename numerous debian control elements
Replace the name emby/emby-server with jellyfin everywhere.
Diffstat (limited to 'debian/postinst')
-rw-r--r--debian/postinst48
1 files changed, 24 insertions, 24 deletions
diff --git a/debian/postinst b/debian/postinst
index f1469f1c1..c2e46d454 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -1,45 +1,45 @@
#!/bin/bash
set -e
-NAME=emby-server
+NAME=jellyfin
CONF_FILE=/etc/${NAME}.conf
DEFAULT_FILE=/etc/default/${NAME}
-# Source Emby server default configuration
+# Source Jellyfin default configuration
if [[ -f $DEFAULT_FILE ]]; then
. $DEFAULT_FILE
fi
-# Source Emby server user configuration overrides
+# Source Jellyfin user configuration overrides
if [[ -f $CONF_FILE ]]; then
. $CONF_FILE
fi
# Data directory where Emby database, cache and logs are stored
-PROGRAMDATA=${EMBY_DATA-/var/lib/$NAME}
+PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME}
case "$1" in
configure)
- # create emby group if it does not exist
- if [[ -z "$(getent group emby)" ]]; then
- addgroup --quiet --system emby > /dev/null 2>&1
+ # create jellyfin group if it does not exist
+ if [[ -z "$(getent group jellyfin)" ]]; then
+ addgroup --quiet --system jellyfin > /dev/null 2>&1
fi
- # create emby user if it does not exist
- if [[ -z "$(getent passwd emby)" ]]; then
- adduser --system --ingroup emby --shell /bin/false emby --no-create-home --home ${PROGRAMDATA} \
- --gecos "Emby Server default user" > /dev/null 2>&1
+ # create jellyfin user if it does not exist
+ if [[ -z "$(getent passwd jellyfin)" ]]; then
+ adduser --system --ingroup jellyfin --shell /bin/false jellyfin --no-create-home --home ${PROGRAMDATA} \
+ --gecos "Jellyfin default user" > /dev/null 2>&1
fi
# ensure $PROGRAMDATA has appropriate permissions
if [[ ! -d $PROGRAMDATA ]]; then
mkdir $PROGRAMDATA
- chown -R emby:emby $PROGRAMDATA
+ chown -R jellyfin:jellyfin $PROGRAMDATA
fi
- # ensure emby-server binary has appropriate permissions
- chmod 755 /usr/bin/emby-server
+ # ensure jellyfin binary has appropriate permissions
+ chmod 755 /usr/bin/jellyfin
- /usr/bin/mono --aot=full -O=all $EMBY_BIN > /dev/null 2>&1 || true
+ /usr/bin/mono --aot=full -O=all $JELLYFIN_BIN > /dev/null 2>&1 || true
- chmod +x ${EMBY_DIR}/restart.sh > /dev/null 2>&1 || true
+ chmod +x ${JELLYFIN_DIR}/restart.sh > /dev/null 2>&1 || true
;;
abort-upgrade|abort-remove|abort-deconfigure)
@@ -54,16 +54,16 @@ esac
if [[ -x "/usr/bin/deb-systemd-helper" ]]; then
# Manual init script handling
- deb-systemd-helper unmask emby-server.service >/dev/null || true
+ deb-systemd-helper unmask jellyfin.service >/dev/null || true
# was-enabled defaults to true, so new installations run enable.
- if deb-systemd-helper --quiet was-enabled emby-server.service; then
+ if deb-systemd-helper --quiet was-enabled jellyfin.service; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
- deb-systemd-helper enable emby-server.service >/dev/null || true
+ deb-systemd-helper enable jellyfin.service >/dev/null || true
else
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
- deb-systemd-helper update-state emby-server.service >/dev/null || true
+ deb-systemd-helper update-state jellyfin.service >/dev/null || true
fi
fi
@@ -72,10 +72,10 @@ fi
if [[ "$1" == "configure" ]] || [[ "$1" == "abort-upgrade" ]]; then
if [[ -d "/run/systemd/systemd" ]]; then
systemctl --system daemon-reload >/dev/null || true
- deb-systemd-invoke start emby-server >/dev/null || true
- elif [[ -x "/etc/init.d/emby-server" ]] || [[ -e "/etc/init/emby-server.conf" ]]; then
- update-rc.d emby-server defaults >/dev/null
- invoke-rc.d emby-server start || exit $?
+ deb-systemd-invoke start jellyfin >/dev/null || true
+ elif [[ -x "/etc/init.d/jellyfin" ]] || [[ -e "/etc/init/jellyfin.conf" ]]; then
+ update-rc.d jellyfin defaults >/dev/null
+ invoke-rc.d jellyfin start || exit $?
fi
fi
exit 0