-
Notifications
You must be signed in to change notification settings - Fork 68
/
sqlshell.sh
executable file
·41 lines (34 loc) · 1.2 KB
/
sqlshell.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
DIR=$(pwd)
if hash rlwrap 2>/dev/null; then
echo -en "\n ========= rlwrap detected and enabled. Use up and down arrow keys to scroll through command line history. ======== \n\n"
RLWRAP=rlwrap
else
echo -en "\n ========= rlwrap not detected. Consider installing for command line history capabilities. ========= \n\n"
RLWRAP=
fi
echo "Running Splice Machine SQL shell"
echo "For help: \"splice> help;\""
if [ $# -ge 1 ] && [ $1 = "debug" ]
then
# debug: use like
# ./sqlshell.sh debug # debug port = 4010 (default)
# or
# /sqlshell.sh debug 5005 # debug port = 5005
port=4010
if [ $# -eq 2 ]
then
port=$2
fi
export MAVEN_OPTS="${MAVEN_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$port"
fi
if [ -z "${CLIENT_SSL_KEYSTORE}" ]; then
cd splice_machine ; ${RLWRAP} mvn exec:java ; cd ${DIR}
else
cd splice_machine ; ${RLWRAP} mvn exec:java \
-Djavax.net.ssl.keyStore=${CLIENT_SSL_KEYSTORE} \
-Djavax.net.ssl.keyStorePassword=${CLIENT_SSL_KEYSTOREPASSWD} \
-Djavax.net.ssl.trustStore=${CLIENT_SSL_TRUSTSTORE} \
-Djavax.net.ssl.trustStore.ssl.trustStorePassword=${CLIENT_SSL_TRUSTSTOREPASSWD} \
; cd ${DIR}
fi