ndbc 816 Bytes
#!/bin/bash

# Look for the NanoDB server JAR file in the target directory
NANODB_SERVER_JAR=`ls target/nanodb-server-*.jar 2>/dev/null`
if [ -z "$NANODB_SERVER_JAR" ]
then
    echo "Can't find NanoDB server JAR file.  Have you built the project?"
    exit 1
fi

# To set the page-size to use, add "-Dnanodb.pagesize=2048" to JAVA_OPTS.
# To enable transaction processing, add "-Dnanodb.txns=on" to JAVA_OPTS.
JAVA_OPTS="-Dlog4j.configurationFile=log4j2.properties"

# See if we have the rlwrap utility; if so, it makes using NanoDB
# from the command-line sooo much nicer...
testrl=$(which rlwrap)
if [ -z "$testrl" ]
then
    java $JAVA_OPTS -cp $NANODB_SERVER_JAR edu.caltech.nanodb.client.SharedServerClient
else
    rlwrap java $JAVA_OPTS -cp $NANODB_SERVER_JAR edu.caltech.nanodb.client.SharedServerClient
fi