Created
July 28, 2023 15:20
-
-
Save bschonec/9088abd158837f0b783105c38c36b63a to your computer and use it in GitHub Desktop.
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
rpm -qi --scripts msodbcsql17 | |
Name : msodbcsql17 | |
Version : 17.10.4.1 | |
Release : 1 | |
Architecture: x86_64 | |
Install Date: Fri 28 Jul 2023 11:13:28 AM EDT | |
Group : Applications/Driver | |
Size : 2329576 | |
License : https://aka.ms/odbc17eula | |
Signature : RSA/SHA256, Tue 25 Apr 2023 12:17:50 PM EDT, Key ID eb3e94adbe1229cf | |
Source RPM : msodbcsql17-17.10.4.1-1.src.rpm | |
Build Date : Tue 25 Apr 2023 12:17:00 PM EDT | |
Build Host : | |
Relocations : (not relocatable) | |
Packager : Microsoft SQL ODBC Team <mssql-odbc@microsoft.com> | |
Summary : ODBC Driver for Microsoft(R) SQL Server(R) | |
Description : | |
This package provides an ODBC driver that can connect to Microsoft(R) SQL Server(R). | |
preinstall scriptlet (using /bin/sh): | |
# check if Driver 17 is installed | |
check_driver() | |
{ | |
exit_code=0 | |
odbcinst -q -d -n "ODBC Driver $1 for SQL Server" &>/dev/null || exit_code=$? | |
if (( exit_code == 0 )) ; then | |
# Driver 17 found, abort the installation | |
echo "Installation failed, ODBC Driver $1 for SQL Server detected!" >&2 | |
exit 1 | |
fi | |
} | |
check_eula_acceptance() | |
{ | |
if [ "$ACCEPT_EULA" != "y" ] && [ "$ACCEPT_EULA" != "Y" ]; then | |
exec 2>/dev/tty 1>&2 </dev/tty | |
echo "The license terms for this product can be downloaded from" | |
echo "https://aka.ms/odbc17eula and found in" | |
echo "/usr/share/doc/msodbcsql17/LICENSE.txt . By entering 'YES'," | |
echo "you indicate that you accept the license terms." | |
echo "" | |
while true; do | |
echo "Do you accept the license terms? (Enter YES or NO)" | |
if read ACCEPT_EULA ; then | |
ACCEPT_EULA_UPPERCASE=`echo ${ACCEPT_EULA} | tr a-z A-Z` | |
if [ "${ACCEPT_EULA_UPPERCASE}" = "YES" ] ; then | |
break | |
elif [ "${ACCEPT_EULA_UPPERCASE}" = "NO" ] ; then | |
echo "Installation terminated: License terms not accepted." | |
exit 1 | |
else | |
echo "Please enter YES or NO" | |
fi | |
else | |
echo "Installation terminated: Could not prompt for license acceptance." | |
echo "If you are performing an unattended installation, you may set" | |
echo "ACCEPT_EULA to Y to indicate your acceptance of the license terms." | |
exit 1 | |
fi | |
done | |
fi | |
} | |
if [ "$1" = "1" ]; then | |
# check if Driver 17 is installed only in the initial installation case | |
check_driver 17 | |
fi | |
check_eula_acceptance | |
postinstall scriptlet (using /bin/sh): | |
/sbin/ldconfig | |
odbcinst -i -d -f /opt/microsoft/msodbcsql17/etc/odbcinst.ini | |
preuninstall scriptlet (using /bin/sh): | |
if [ "$1" = "0" ] ; then | |
rm -f /usr/lib64/libmsodbcsql-17.so | |
fi | |
postuninstall scriptlet (using /bin/sh): | |
/sbin/ldconfig | |
odbcinst -u -d -n "ODBC Driver 17 for SQL Server" | |
posttrans scriptlet (using /bin/sh): | |
ln -sf /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.4.1 /usr/lib64/libmsodbcsql-17.so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment