-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtestsql.txt
More file actions
19 lines (14 loc) · 897 Bytes
/
testsql.txt
File metadata and controls
19 lines (14 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# from http://redsymbol.net/articles/unofficial-bash-strict-mode/
# set -e option instructs bash to immediately exit if any command [1] has a non-zero exit status
# when set -u is set, a reference to any variable you haven't previously defined - with the exceptions of $* and $@ - is an error, and causes the program to immediately exit
# set -o pipefail: If any command in a pipeline fails, that return code will be used as the return code of the whole pipeline
set -euo pipefail
#
# This script is meant for quick & easy install via:
# 'curl -sSL https://healthcatalyst.github.io/InstallScripts/testsql.txt | sh -s <server>'
u="$(whoami)"
echo "Running version 1.01 as: $u"
servername="$1"
/opt/mssql-tools/bin/sqlcmd -S $servername -Q 'SET NOCOUNT ON; SELECT SUSER_NAME()' -h-1
/opt/mssql-tools/bin/sqlcmd -S $servername -Q 'SET NOCOUNT ON;select name from sys.databases' -h-1