Skip to content

Instantly share code, notes, and snippets.

@mgkuhn
Created July 17, 2018 18:04
Show Gist options
  • Save mgkuhn/ff7eb778841edd1860c98657d31150aa to your computer and use it in GitHub Desktop.
Save mgkuhn/ff7eb778841edd1860c98657d31150aa to your computer and use it in GitHub Desktop.
Better check_eula_acceptance() function for msodbcsql17/DEBIAN/preinst
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
}
@mgkuhn
Copy link
Author

mgkuhn commented Jul 17, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment