#!/bin/sh
# postinst script for ee-backuppc-api
#
# see: dh_installdeb(1)

set -e

case "$1" in
    configure)
        OVERRIDDEN=`dpkg-statoverride --list /usr/lib/ee-backuppc-api/cgi-bin/index.cgi || true`
        # Force the perms to 4750 if 4755 was found
        echo "$OVERRIDDEN" | grep -q 4755 && OVERRIDDEN=""
        [ "${OVERRIDDEN}" = "" ] && dpkg-statoverride --force-all --update --add backuppc www-data 4750 /usr/lib/ee-backuppc-api/cgi-bin/index.cgi
    ;;
    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0
