#!/bin/bash -e . /usr/share/debconf/confmodule case "$1" in purge) db_purge ;; remove) odbcinst -u -d -n "ODBC Driver 18 for SQL Server" db_purge ;; upgrade) odbcinst -u -d -n "ODBC Driver 18 for SQL Server" ;; abort-install) # No need to call odbcinst to remove the driver entry, the driver hasn't been added yet. # It would also break the existing Driver 13 installation (installed in an old way). db_purge ;; abort-upgrade) # if the user doesn't accept the license we need to set it back to accepted (the state of the # old package should stay the same). db_set msodbcsql/accept_eula true if [ "$2" = "13.0.0.0.preview-1" ]; then # Because the 13.0.0.0.preview-1 package adds the driver to odbcinst.ini unconditionally, # it will increase the count upon an unsuccessful upgrade. We need to decrease the count here. odbcinst -u -d -n "ODBC Driver 13 for SQL Server" fi ;; failed-upgrade|disappear) ;; *) echo "postrm called with an unknown argument '$1'" >&2 exit 1 esac exit 0