#!/bin/sh # postinst script for mopidy set -e . /usr/share/debconf/confmodule # Automatically added by dh_python3 if command -v py3compile >/dev/null 2>&1; then py3compile -p mopidy fi if command -v pypy3compile >/dev/null 2>&1; then pypy3compile -p mopidy || true fi # End automatically added section # Automatically added by dh_installdeb/13.16 dpkg-maintscript-helper rm_conffile /etc/mopidy/logging.conf 2.3.1-1\~ -- "$@" # End automatically added section # Automatically added by dh_installinit/13.16 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "/etc/init.d/mopidy" ]; then update-rc.d mopidy defaults >/dev/null || exit 1 fi fi # End automatically added section # Automatically added by dh_installsystemd/13.16 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if deb-systemd-helper debian-installed 'mopidy.service'; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'mopidy.service' >/dev/null || true if deb-systemd-helper --quiet was-enabled 'mopidy.service'; then # Create new symlinks, if any. deb-systemd-helper enable 'mopidy.service' >/dev/null || true fi fi # 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 'mopidy.service' >/dev/null || true fi # End automatically added section case "$1" in configure|reconfigure) adduser --quiet --system --no-create-home --home /var/lib/mopidy --ingroup audio mopidy chown mopidy:audio /var/cache/mopidy chown mopidy:audio /var/lib/mopidy chown mopidy:audio /var/lib/mopidy/m3u # mopidy.conf may contain passwords and other confidential information if [ -e /etc/mopidy/mopidy.conf ]; then chown mopidy:root /etc/mopidy/mopidy.conf chmod 640 /etc/mopidy/mopidy.conf fi db_get mopidy/daemon if [ "$RET" = "true" ]; then update-rc.d mopidy enable >/dev/null invoke-rc.d mopidy start || exit $? else update-rc.d mopidy disable >/dev/null invoke-rc.d mopidy stop || exit $? fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac exit 0