postinst is in mopidy 2.1.0-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | #!/bin/sh
# postinst script for mopidy
set -e
. /usr/share/debconf/confmodule
# Automatically added by dh_python2:
if which pycompile >/dev/null 2>&1; then
pycompile -p mopidy
fi
# End automatically added section
# Automatically added by dh_systemd_enable
if deb-systemd-helper debian-installed mopidy.service; then
# This will only remove masks created by d-s-h on package removal.
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
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/mopidy" ]; then
update-rc.d mopidy defaults >/dev/null || exit $?
fi
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/local
chown mopidy:audio /var/lib/mopidy/media
chown mopidy:audio /var/lib/mopidy/playlists
chown mopidy:audio /var/log/mopidy
# 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
|