#!/bin/sh # $Id$ # postinst script for SqueezeCenter set -e . /usr/share/debconf/confmodule case "$1" in configure) # If it's an upgrade, make chown verbose if [ "$2" != "" ] ; then VERBOSE="-c" else VERBOSE="" fi # Remove the old Favorites module. rm -rf /var/lib/squeezecenter/Plugins/Favorites # Create a "squeezecenter" user. This has modeled after the code in the postfix.deb # postinst. We first try to set the ownership of /var/lib/squeezecenter. If that # fails, we create the user and re-try. If that still fails, we abort. # Note that the Firmware directory has to be owned by squeezecenter, since the # server may download files to there during operation. if chown squeezecenter:nogroup /var/log/squeezecenter 2>/dev/null ; then chown $VERBOSE squeezecenter:nogroup /etc/squeezecenter -R chown $VERBOSE squeezecenter:nogroup /var/cache/squeezecenter -R chown $VERBOSE squeezecenter:nogroup /var/log/squeezecenter -R elif adduser --system --home /usr/share/squeezecenter --no-create-home --gecos "SqueezeCenter" squeezecenter ; then sleep 1 # wait for user creation chown $VERBOSE squeezecenter:nogroup /etc/squeezecenter -R chown $VERBOSE squeezecenter:nogroup /var/cache/squeezecenter -R chown $VERBOSE squeezecenter:nogroup /var/log/squeezecenter -R fi db_stop ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0