forked from 33root/neo4django
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_local_neo4j.bash
executable file
·35 lines (32 loc) · 1.24 KB
/
install_local_neo4j.bash
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
#!/bin/bash
DEFAULT_VERSION="1.8.2"
VERSION=${1-$DEFAULT_VERSION}
DIR="neo4j-community-$VERSION"
FILE="$DIR-unix.tar.gz"
SERVER_PROPERTIES_FILE="lib/neo4j/conf/neo4j-server.properties"
#set a default neo4j port if none has been set
NEO4J_PORT=${NEO4J_PORT:="7474"}
if [[ ! -d lib/$DIR ]]; then
wget http://dist.neo4j.org/$FILE
tar xvfz $FILE &> /dev/null
rm $FILE
[[ ! -d lib ]] && mkdir lib
mv $DIR lib/
[[ -h lib/neo4j ]] && unlink lib/neo4j
ln -fs $DIR lib/neo4j
mkdir lib/neo4j/testing/
PLUGIN_VERSION="1.6"
if [[ $NEO4J_VERSION == 1.5* ]]; then
PLUGIN_VERSION="1.5"
fi
DELETE_DB_PLUGIN_JAR="test-delete-db-extension-$PLUGIN_VERSION.jar"
wget --no-check-certificate -O lib/neo4j/testing/$DELETE_DB_PLUGIN_JAR https://github.com/downloads/jexp/neo4j-clean-remote-db-addon/$DELETE_DB_PLUGIN_JAR
ln -s ../testing/$DELETE_DB_PLUGIN_JAR lib/neo4j/plugins/$DELETE_DB_PLUGIN_JAR
cat >> $SERVER_PROPERTIES_FILE <<EOF
org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.server.extension.test.delete=/cleandb
org.neo4j.server.thirdparty.delete.key=supersecretdebugkey!
EOF
fi
if grep 7474 $SERVER_PROPERTIES_FILE > /dev/null; then
sed -i s/7474/$NEO4J_PORT/g $SERVER_PROPERTIES_FILE #change port
fi