@@ -36,19 +36,21 @@ GRAPH_CONF="hugegraph.properties"
36
36
37
37
# make a backup
38
38
BAK_CONF=" $TOP /conf-bak"
39
- mkdir -p " $BAK_CONF "
40
- cp " ${CONF} /${GREMLIN_SERVER_CONF} " " ${BAK_CONF} /${GREMLIN_SERVER_CONF} .bak"
41
- cp " ${CONF} /${REST_SERVER_CONF} " " ${BAK_CONF} /${REST_SERVER_CONF} .bak"
42
- cp " ${CONF} /graphs/${GRAPH_CONF} " " ${BAK_CONF} /${GRAPH_CONF} .bak"
39
+ if [ ! -d " $BAK_CONF " ]; then
40
+ mkdir -p " $BAK_CONF "
41
+ cp " ${CONF} /${GREMLIN_SERVER_CONF} " " ${BAK_CONF} /${GREMLIN_SERVER_CONF} .bak"
42
+ cp " ${CONF} /${REST_SERVER_CONF} " " ${BAK_CONF} /${REST_SERVER_CONF} .bak"
43
+ cp " ${CONF} /graphs/${GRAPH_CONF} " " ${BAK_CONF} /${GRAPH_CONF} .bak"
43
44
44
45
45
- sed -i -e ' $a\authentication: {' \
46
- -e ' $a\ authenticator: org.apache.hugegraph.auth.StandardAuthenticator,' \
47
- -e ' $a\ authenticationHandler: org.apache.hugegraph.auth.WsAndHttpBasicAuthHandler,' \
48
- -e ' $a\ config: {tokens: conf/rest-server.properties}' \
49
- -e ' $a\}' ${CONF} /${GREMLIN_SERVER_CONF}
46
+ sed -i -e ' $a\authentication: {' \
47
+ -e ' $a\ authenticator: org.apache.hugegraph.auth.StandardAuthenticator,' \
48
+ -e ' $a\ authenticationHandler: org.apache.hugegraph.auth.WsAndHttpBasicAuthHandler,' \
49
+ -e ' $a\ config: {tokens: conf/rest-server.properties}' \
50
+ -e ' $a\}' ${CONF} /${GREMLIN_SERVER_CONF}
50
51
51
- sed -i -e ' $a\auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator' \
52
- -e ' $a\auth.graph_store=hugegraph' ${CONF} /${REST_SERVER_CONF}
52
+ sed -i -e ' $a\auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator' \
53
+ -e ' $a\auth.graph_store=hugegraph' ${CONF} /${REST_SERVER_CONF}
53
54
54
- sed -i ' s/gremlin.graph=org.apache.hugegraph.HugeFactory/gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy/g' ${CONF} /graphs/${GRAPH_CONF}
55
+ sed -i ' s/gremlin.graph=org.apache.hugegraph.HugeFactory/gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy/g' ${CONF} /graphs/${GRAPH_CONF}
56
+ fi
0 commit comments