forked from antfin/OpenHospital
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup.sh
108 lines (92 loc) · 2.38 KB
/
startup.sh
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
#!/bin/sh
######## Environment check:
# check for java home
JAVA_EXE=$JAVA_HOME/bin/java
if [ -z $JAVA_HOME ]; then
echo "JAVA_HOME not found. Please set it up properly."
JAVA_EXE=java
fi
######## OPENHOSPITAL Configuration:
# add the libraries to the OPENHOSPITAL_CLASSPATH.
# EXEDIR is the directory where this executable is.
EXEDIR=${0%/*}
DIRLIBS=${EXEDIR}/bin/*.jar
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
DIRLIBS=${EXEDIR}/lib/*.jar
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
DIRLIBS=${EXEDIR}/lib/h8/*.jar
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
DIRLIBS=${EXEDIR}/lib/dicom/*.jar
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
DIRLIBS=${EXEDIR}/lib/dicom/dcm4che/*.jar
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
DIRLIBS=${EXEDIR}/lib/dicom/jai/*.jar
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
DIRLIBS=${EXEDIR}/lib/*.zip
for i in ${DIRLIBS}
do
if [ -z "$OPENHOSPITAL_CLASSPATH" ] ; then
OPENHOSPITAL_CLASSPATH=$i
else
OPENHOSPITAL_CLASSPATH="$i":$OPENHOSPITAL_CLASSPATH
fi
done
OPENHOSPITAL_CLASSPATH="${EXEDIR}/../classes":$OPENHOSPITAL_CLASSPATH
OPENHOSPITAL_CLASSPATH="${EXEDIR}/bundle":$OPENHOSPITAL_CLASSPATH
OPENHOSPITAL_CLASSPATH="${EXEDIR}":$OPENHOSPITAL_CLASSPATH
OPENHOSPITAL_HOME="${EXEDIR}"
ARCH=$(uname -m)
case $ARCH in
x86_64|amd64|AMD64)
NATIVE_LIB_PATH=${OPENHOSPITAL_HOME}/lib/native/Linux/amd64
;;
i[3456789]86|x86|i86pc)
NATIVE_LIB_PATH=${OPENHOSPITAL_HOME}/lib/native/Linux/i386
;;
*)
echo "Unknown architecture $(uname -m)"
;;
esac
$JAVA_EXE -Dsun.java2d.dpiaware=false -Djava.library.path=${NATIVE_LIB_PATH} -classpath "$OPENHOSPITAL_CLASSPATH:$CLASSPATH" org.isf.menu.gui.Menu "$@"