Created
July 17, 2018 18:04
-
-
Save mgkuhn/ff7eb778841edd1860c98657d31150aa to your computer and use it in GitHub Desktop.
Better check_eula_acceptance() function for msodbcsql17/DEBIAN/preinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check_eula_acceptance() | |
{ | |
case "$ACCEPT_EULA" in | |
[Yy]|[Yy]es|[Tt]rue) | |
db_set msodbcsql/accept_eula true | |
;; | |
[Nn]|[Nn]o|[Ff]alse) | |
db_set msodbcsql/accept_eula false | |
;; | |
'') ;; | |
*) | |
echo "ERROR: Unknown value in ACCEPT_EULA, try 'y' or 'n'." >&2 | |
exit 1 | |
esac | |
db_get msodbcsql/accept_eula | |
if [ "$RET" != "true" ]; then | |
db_fset msodbcsql/accept_eula seen false | |
db_input high msodbcsql/accept_eula || true | |
db_go | |
db_get msodbcsql/accept_eula | |
if [ "$RET" != "true" ]; then | |
echo "ERROR: The EULA was not accepted. Installation aborted." >&2 | |
exit 1 | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please use this function to replace the existing check_eula_acceptance() in the Debian/Ubuntu packages of Microsoft ODBC Driver for SQL Server, such that users can alternatively use the
dpkg-preconfigure
command to answer the EULA question in advance, before the package is installed, which will significantly improve compatibility with automated deployment tools.