Skip to content

Instantly share code, notes, and snippets.

@kavu
Created October 27, 2012 19:38
Show Gist options
  • Save kavu/3965837 to your computer and use it in GitHub Desktop.
Save kavu/3965837 to your computer and use it in GitHub Desktop.
Homebrew OrientDB Formula patch
diff --git a/bin/console.sh b/bin/console.sh
index 1932011..5edbeae 100644
--- a/bin/console.sh
+++ b/bin/console.sh
@@ -3,24 +3,10 @@
# Copyright (c) 1999-2010 Luca Garulli
#
-# resolve links - $0 may be a softlink
-PRG="$0"
-
-while [ -h "$PRG" ]; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`/"$link"
- fi
-done
-
-# Get standard environment variables
-PRGDIR=`dirname "$PRG"`
+ORIENTDB_HOME="YOUR_ORIENTDB_INSTALLATION_PATH"
# Only set ORIENTDB_HOME if not already set
-[ -f "$ORIENTDB_HOME"/lib/orientdb-tools-1.2.0.jar ] || ORIENTDB_HOME=`cd "$PRGDIR/.." ; pwd`
+[ -f "$ORIENTDB_HOME"/lib/orientdb-tools-1.2.0.jar ] ||
export ORIENTDB_HOME
ORIENTDB_SETTINGS="-Dcache.level1.enabled=false -Dcache.level2.enabled=false"
diff --git a/bin/gremlin.sh b/bin/gremlin.sh
index 1db7161..7147bec 100644
--- a/bin/gremlin.sh
+++ b/bin/gremlin.sh
@@ -5,7 +5,8 @@ case `uname` in
CP=$( echo `dirname $0`/../lib/*.jar . | sed 's/ /;/g')
;;
*)
- CP=$( echo `dirname $0`/../lib/*.jar . | sed 's/ /:/g')
+ ORIENTDB_DIR="YOUR_ORIENTDB_INSTALLATION_PATH"
+ CP=$( echo $ORIENTDB_DIR/lib/*.jar . | sed 's/ /:/g')
esac
echo $CP
diff --git a/bin/orientdb.sh b/bin/orientdb.sh
index e8cc970..be3ec19 100644
--- a/bin/orientdb.sh
+++ b/bin/orientdb.sh
@@ -4,7 +4,6 @@
# You have to SET the OrientDB installation directory here
ORIENTDB_DIR="YOUR_ORIENTDB_INSTALLATION_PATH"
-ORIENTDB_USER="USER_YOU_WANT_ORIENTDB_RUN_WITH"
usage() {
echo "Usage: `basename $0`: <start|stop|status>"
@@ -20,7 +19,7 @@ start() {
fi
echo "Starting OrientDB server daemon..."
cd "$ORIENTDB_DIR/bin"
- su -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./server.sh 1>../log/orientdb.log 2>../log/orientdb.err &" - $ORIENTDB_USER
+ /usr/bin/nohup ./server.sh 1>../log/orientdb.log 2>../log/orientdb.err &
}
stop() {
@@ -32,7 +31,7 @@ stop() {
fi
echo "Stopping OrientDB server daemon..."
cd "$ORIENTDB_DIR/bin"
- su -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./shutdown.sh 1>>../log/orientdb.log 2>>../log/orientdb.err &" - $ORIENTDB_USER
+ /usr/bin/nohup ./shutdown.sh 1>>../log/orientdb.log 2>>../log/orientdb.err &
}
status() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment