From b8fcd9e1f39cab3ba69fe2ea135e29b2e6eb187e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20L=C3=B6ki?= Date: Fri, 19 Jun 2026 13:42:40 +0200 Subject: [PATCH 1/2] Support symlinks to phoebus.sh Use realpath to resolve symbolic links to determine where TOP is --- phoebus-product/phoebus.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phoebus-product/phoebus.sh b/phoebus-product/phoebus.sh index c6f44d7306..1b8598fb0b 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 From 2802198ba13b52b17af2eedfca8345f9b41da4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20L=C3=B6ki?= Date: Fri, 19 Jun 2026 13:48:25 +0200 Subject: [PATCH 2/2] Use quotes when referencing ${TOP} Needed if the path contains spaces --- phoebus-product/phoebus.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phoebus-product/phoebus.sh b/phoebus-product/phoebus.sh index 1b8598fb0b..0147773669 100755 --- a/phoebus-product/phoebus.sh +++ b/phoebus-product/phoebus.sh @@ -20,7 +20,7 @@ fi if [ -d "${TOP}/update" ] then echo "Installing update..." - cd ${TOP} + cd "${TOP}" rm -rf doc lib mv update/* . rmdir update @@ -28,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" @@ -41,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