forked from marcelocf/janusgraph_tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_janus.sh
More file actions
executable file
·60 lines (44 loc) · 1.43 KB
/
start_janus.sh
File metadata and controls
executable file
·60 lines (44 loc) · 1.43 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
#
# this will make sure janus is downloaded and running
JANUS_VERSION=0.1.0
function realpathMac() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
case "$OSTYPE" in
darwin*) WORKDIR="$(realpathMac `dirname $0`)/work" ;;
*) WORKDIR="$(realpath `dirname $0`)/work" ;;
esac
JDIR=janusgraph-${JANUS_VERSION}-hadoop2
PKGNAME=${JDIR}.zip
JPATH="${WORKDIR}/${JDIR}"
function janus_exists(){
test -d "${JPATH}"
}
function download_janus(){
echo Downloading janus
mkdir -p $WORKDIR
cd "$WORKDIR"
case "$OSTYPE" in
darwin*) curl -LO https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/${PKGNAME} ;;
*) wget -c https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/${PKGNAME} ;;
esac
echo Extracting
unzip -o -q $PKGNAME
}
janus_exists || download_janus
echo starting janus
# make sure it is not running first
cd "$JPATH" && ./bin/janusgraph.sh stop
cd "$JPATH" && ./bin/janusgraph.sh start
cat << EOF
=================================================
|| JanusGraph should be running now! ||
|| ||
|| Go ahead and try the code in this tutorial! ||
|| ||
|| I hope you have fun learning. ||
|| ||
|| Marcelo C. Freitas ||
=================================================
EOF