#!/bin/bash
# postinst script for xivo-utils
#
# see: dh_installdeb(1)

set -e

LOG_FILENAME="/var/log/xivo-xuc-agent-webservices.log"
SCRIPT="/var/lib/asterisk/agi-bin/xuc-request.py"

case "$1" in
    configure)
        if [ ! -e "$LOG_FILENAME" ]; then
            touch "$LOG_FILENAME"
        fi

        chown asterisk:asterisk "$LOG_FILENAME"

        chown -R asterisk:asterisk "$SCRIPT"
    ;;

    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

