forked from jameswsullivan/docker-dspace-handle-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hdl
149 lines (142 loc) · 4.26 KB
/
hdl
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/sh
PRG=$0
#progname=`basename $0`
# Resolve symlinks. See 4152645.
while [ -L "$PRG" ]; do
ls=`/bin/ls -ld "$PRG"`
link=`/usr/bin/expr "$ls" : '.*-> \(.*\)$'`
if /usr/bin/expr "$link" : '/' > /dev/null; then
PRG="$link"
else
PRG="`/usr/bin/dirname $PRG`/$link"
fi
done
#unset JAVA_HOME
unset CLASSPATH
# Get the full name of the directory where the Handle.net software is installed
HDLHOME=`dirname "$PRG"`
HDLHOME="${HDLHOME}/../"
#echo "HDLHOME is $HDLHOME"
# Load all of the .jar files in the lib directory into the classpath
CP=""
for jarfile in ${HDLHOME}lib/*.jar ; do
CP=${CP}:${jarfile}
done
for jarfile in ${HDLHOME}lib/*/*.jar ; do
CP=${CP}:${jarfile}
done
COMMAND=$1
# Remove command from args to be passed on
shift
# Run appropriate command
case $COMMAND in
server)
# this is the server startup; memory configuration can be edited here
exec java ${JAVA_OPTS} -server -cp "${CP}" -Dlog4j.configuration=file:///hs/svr_1/log4j-handle-plugin.properties -Ddspace.handle.plugin.configuration=/hs/svr_1/handle-dspace-plugin.cfg net.handle.server.Main "$@"
;;
setup-server)
exec java -cp "${CP}" net.handle.server.SimpleSetup "$@"
;;
java)
exec java -cp "${CP}" "$@"
;;
admintool)
exec java -cp "${CP}" net.handle.apps.admintool.controller.Main "$@"
;;
oldadmintool)
exec java -cp "${CP}" net.handle.apps.gui.hadmin.HandleTool "$@"
;;
keyutil)
exec java -cp "${CP}" net.handle.apps.tools.KeyUtil "$@"
;;
keygen)
exec java -cp "${CP}" net.handle.apps.tools.KeyGenerator "$@"
;;
qresolverGUI)
exec java -cp "${CP}" net.handle.apps.gui.resolver.Main "$@"
;;
qresolver)
exec java -cp "${CP}" net.handle.apps.simple.HDLTrace "$@"
;;
getrootinfo)
exec java -cp "${CP}" net.handle.apps.tools.GetRootInfo "$@"
;;
getsiteinfo)
exec java -cp "${CP}" net.handle.apps.tools.GetSiteInfo "$@"
;;
genericbatch)
exec java -cp "${CP}" net.handle.apps.batch.GenericBatch "$@"
;;
create)
exec java -cp "${CP}" net.handle.apps.simple.HDLCreate "$@"
;;
delete)
exec java -cp "${CP}" net.handle.apps.simple.HDLDelete "$@"
;;
list)
exec java -cp "${CP}" net.handle.apps.simple.HDLList "$@"
;;
trace)
exec java -cp "${CP}" net.handle.apps.simple.HDLTrace "$@"
;;
home-na)
exec java -cp "${CP}" net.handle.apps.simple.HomeNA "$@"
;;
convert-siteinfo)
exec java -cp "${CP}" net.handle.apps.simple.SiteInfoConverter "$@"
;;
convert-values)
exec java -cp "${CP}" net.handle.apps.simple.HandleValuesConverter "$@"
;;
convert-localinfo)
exec java -cp "${CP}" net.handle.apps.simple.LocalInfoConverter "$@"
;;
convert-key)
exec java -cp "${CP}" net.handle.apps.simple.KeyConverter "$@"
;;
dumpfromprimary)
exec java -cp "${CP}" net.handle.server.replication.DumpHandles "$@"
;;
dbtool)
exec java -cp "${CP}" net.handle.apps.db_tool.DBTool "$@"
;;
dblist)
exec java -cp "${CP}" net.handle.apps.db_tool.DBList "$@"
;;
bdbje-util)
exec java -cp "${CP}" net.handle.server.bdbje.BDBJEHandleStorage "$@"
;;
dbremove)
exec java -cp "${CP}" net.handle.apps.db_tool.DBRemove "$@"
;;
dbresolve)
exec java -cp "${CP}" net.handle.apps.db_tool.DBResolve "$@"
;;
testtool)
exec java -cp "${CP}" net.handle.apps.test.Test "$@"
;;
docheckpoint)
exec java -cp "${CP}" net.handle.apps.tools.DoCheckpoint "$@"
;;
splitserver)
exec java -cp "${CP}" net.handle.apps.tools.SplitServer "$@"
;;
splitrecoverylog)
exec java -cp "${CP}" net.handle.apps.tools.SplitRecoveryLog "$@"
;;
recoverjdb)
exec java -cp "${CP}" net.handle.apps.tools.RecoverJDB "$@"
;;
recoverbdbje)
exec java -cp "${CP}" net.handle.apps.tools.RecoverBDBJE "$@"
;;
server-perf-test)
exec java -cp "${CP}" net.handle.hdllib.Tester "$@"
;;
migrate-storage-to-bdbje)
exec java -cp "${CP}" net.handle.apps.tools.CurrentStorageToBdbjeMigrator "$@"
;;
*)
echo "Unknown Handle.Net server command: ${COMMAND}"
;;
esac