diff --git a/phoebus-product/phoebus.sh b/phoebus-product/phoebus.sh index c6f44d7306..0147773669 100755 --- a/phoebus-product/phoebus.sh +++ b/phoebus-product/phoebus.sh @@ -5,7 +5,8 @@ # When deploying, change "TOP" # to the absolute installation path # TOP="." -TOP="$( cd "$(dirname "$0")" ; pwd -P )" +realpath=$(realpath "$0") +TOP=$(dirname "$realpath") # Ideally, assert that Java is found # export JAVA_HOME=/opt/jdk-9 @@ -19,7 +20,7 @@ fi if [ -d "${TOP}/update" ] then echo "Installing update..." - cd ${TOP} + cd "${TOP}" rm -rf doc lib mv update/* . rmdir update @@ -27,7 +28,7 @@ then fi -JAR=`echo ${TOP}/product-*.jar` +JAR=`echo "${TOP}"/product-*.jar` # To get one instance, use server mode OPT="-server 4918" @@ -40,10 +41,10 @@ firstarg=$1; if test "${firstarg#*$filter1}" != "$firstarg"; then # Run MEDM converter etc. in foreground - java -Dfile.encoding=UTF-8 -jar $JAR $OPT "$@" + java -Dfile.encoding=UTF-8 -jar "$JAR" $OPT "$@" elif test "${firstarg#*$filter2}" != "$firstarg"; then - java -Dfile.encoding=UTF-8 -jar $JAR $OPT "$@" + java -Dfile.encoding=UTF-8 -jar "$JAR" $OPT "$@" else # Run UI as separate thread - java -Dfile.encoding=UTF-8 -jar $JAR $OPT "$@" & + java -Dfile.encoding=UTF-8 -jar "$JAR" $OPT "$@" & fi