#!/bin/sh set -e case "$1" in configure) # apply bugfix on 2.6 ngcp systems with broken db rev script # /usr/share/ngcp-db-schema/db_scripts/diff/9868.up # ngcp 2.5 repos provides ngcp-db-schema := 0.1.3 # ngcp 2.6 repos provides ngcp-db-schema >= 2.6.3 if [ -n "$2" ] && dpkg --compare-versions "$2" ge 2.6.0 && dpkg --compare-versions "$2" le 2.6.4 ; then echo "Executing ngcp-update-db-schema to address 2.6 db rev script bug." ngcp-update-db-schema if /etc/init.d/kamailio-proxy status >/dev/null ; then if [ -x "$(which invoke-rc.d 2>/dev/null)" ]; then echo "Restarting kamailio proxy to handle db changes" invoke-rc.d kamailio-proxy restart || exit $? else echo "Restarting kamailio proxy to handle db changes" /etc/init.d/kamailio-proxy restart || exit $? fi fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst of ngcp-db-schema called with unknown argument \`$1'" >&2 exit 1 ;; esac exit 0