File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
22
33cd " $( dirname " $0 " ) /.." || exit 1
44rm -f deploy/shutdown.xml
55
6- # Separate -D parameters and handle --pid argument
7- JAVA_OPTS=" ${JAVA_OPTS :- } "
8- OTHER_OPTS=" "
6+ # Initialize arrays for JAVA_OPTS and OTHER_OPTS.
7+ JAVA_OPTS=()
8+ OTHER_OPTS=()
99PID_FILE=" jpos.pid" # Default value
1010
1111for arg in " $@ " ; do
1212 case $arg in
1313 -D* )
14- JAVA_OPTS= " $JAVA_OPTS $ arg"
14+ JAVA_OPTS+=( " $ arg" )
1515 ;;
1616 --pid=* )
1717 PID_FILE=" ${arg# --pid=} "
1818 ;;
1919 * )
20- OTHER_OPTS= " $OTHER_OPTS $ arg"
20+ OTHER_OPTS+=( " $ arg" )
2121 ;;
2222 esac
2323done
2424
2525# Check if the process defined by the PID file is running
26- if [ -f " $PID_FILE " ] && ps -p " $( cat " $PID_FILE " ) " > /dev/null 2>&1
27- then
26+ if [ -f " $PID_FILE " ] && ps -p " $( cat " $PID_FILE " ) " > /dev/null 2>&1 ; then
2827 echo " Process $( cat " $PID_FILE " ) is running"
2928else
3029 rm -f " $PID_FILE "
3433 -Xmx4G \
3534 --enable-preview \
3635 -Xlog:gc:log/gc.log \
37- $ JAVA_OPTS -jar @jarname@ --pid=" $PID_FILE " $ OTHER_OPTS
36+ " ${ JAVA_OPTS[@]} " -jar @jarname@ --pid=" $PID_FILE " " ${ OTHER_OPTS[@]} "
3837fi
You can’t perform that action at this time.
0 commit comments