#!/bin/sh SCRIPT=$0 # SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path. while [ -h "$SCRIPT" ] ; do ls=$(ls -ld "$SCRIPT") # Drop everything prior to -> link=$(expr "$ls" : '.*-> \(.*\)$') if expr "$link" : '/.*' > /dev/null; then SCRIPT="$link" else SCRIPT=$(dirname "$SCRIPT")/"$link" fi done DIR="$(dirname "${SCRIPT}")/.." CONFIG_DIR=${KBN_PATH_CONF:-"$DIR/config"} if [ -f "${CONFIG_DIR}/node.options" ]; then KBN_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)" fi NODE_OPTIONS="--no-warnings --max-http-header-size=65536 $KBN_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production exec node "${DIR}/src/cli/dist" ${@}