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
#!/bin/bash | |
echo "Installing SqlCmd.." | |
if [[ $(sqlcmd | grep Version) != *"13."* ]]; then { | |
repoPrConf="/etc/yum/pluginconf.d/priorities.conf" | |
rm -f ${repoPrConf} | |
cat >> ${repoPrConf} << EOF | |
[main] | |
enabled = 0 | |
EOF | |
chmod 644 ${repoPrConf} | |
curl https://packages.microsoft.com/config/rhel/6/prod.repo > /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" | |
} | |
fi | |
} else { | |
echo "SqlCmd has been already installed" | |
} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment