Skip to content

Instantly share code, notes, and snippets.

Last active May 22, 2022 16:19
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kagarlickij/7cb9ca510695027b0fd2f811a70825e1 to your computer and use it in GitHub Desktop.
echo "Installing SqlCmd.."
if [[ $(sqlcmd | grep Version) != *"13."* ]]; then {
rm -f ${repoPrConf}
cat >> ${repoPrConf} << EOF
enabled = 0
chmod 644 ${repoPrConf}
curl > /etc/yum.repos.d/msprod.repo
yum update -y
ACCEPT_EULA=y yum install mssql-tools -y
sudo ln -s /opt/mssql-tools/bin/sqlcmd /usr/local/bin
if [[ $(sqlcmd | grep Version) != *"13."* ]]; then {
echo "SqlCmd has been installed with error"
exit 1
} else {
echo "SqlCmd has been installed successfully"
} else {
echo "SqlCmd has been already installed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment