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
|
#!/bin/sh
# postinst script for mopidy
set -e
. /usr/share/debconf/confmodule
#DEBHELPER#
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
|