aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJim Unger <BigFunger@gmail.com>2016-03-03 12:44:43 -0600
committerJim Unger <BigFunger@gmail.com>2016-03-17 13:13:35 -0500
commitf6c48779dc24c2858f62bb025d1aa12d3e422015 (patch)
tree898c1aa24b10ebdd9090627ce16d761f07c0c6e5 /bin
parentb00a9d97ac1f87238d94f7916f7584ddcd82c036 (diff)
[pack installer] moved existing files into new structure
Diffstat (limited to 'bin')
-rw-r--r--bin/kibana-plugin24
-rw-r--r--bin/kibana-plugin.bat29
2 files changed, 53 insertions, 0 deletions
diff --git a/bin/kibana-plugin b/bin/kibana-plugin
new file mode 100644
index 000000000..7e8481fa7
--- /dev/null
+++ b/bin/kibana-plugin
@@ -0,0 +1,24 @@
+#!/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}")/.."
+NODE="${DIR}/node/bin/node"
+test -x "$NODE" || NODE=$(which node)
+if [ ! -x "$NODE" ]; then
+ echo "unable to find usable node.js executable."
+ exit 1
+fi
+
+exec "${NODE}" $NODE_OPTIONS "${DIR}/src/cli_plugin" ${@}
diff --git a/bin/kibana-plugin.bat b/bin/kibana-plugin.bat
new file mode 100644
index 000000000..9d8bdc477
--- /dev/null
+++ b/bin/kibana-plugin.bat
@@ -0,0 +1,29 @@
+@echo off
+
+SETLOCAL
+
+set SCRIPT_DIR=%~dp0
+for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI
+
+set NODE=%DIR%\node\node.exe
+
+WHERE /Q node
+IF %ERRORLEVEL% EQU 0 (
+ for /f "delims=" %%i in ('WHERE node') do set SYS_NODE=%%i
+)
+
+If Not Exist "%NODE%" (
+ IF Exist "%SYS_NODE%" (
+ set "NODE=%SYS_NODE%"
+ ) else (
+ Echo unable to find usable node.js executable.
+ Exit /B 1
+ )
+)
+
+TITLE Kibana Server
+"%NODE%" %NODE_OPTIONS% "%DIR%\src\cli_plugin" %*
+
+:finally
+
+ENDLOCAL