From e627269ec64b800b8feaa121aacafb3a49e8375b Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sat, 2 Apr 2022 01:59:40 +0200 Subject: [PATCH] Fix the check, for real this time. --- 06_workspace_mount.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/06_workspace_mount.sh b/06_workspace_mount.sh index 5751a5b..1272772 100644 --- a/06_workspace_mount.sh +++ b/06_workspace_mount.sh @@ -30,14 +30,14 @@ _retval= if [ -d /home/${USER}/workspace ]; then rmdir /home/${USER}/workspace _retval=$? + if [ $_retval -ne 0 ]; then + echo "The user has a directory named 'workspace' inside their home directory and it is not empty." + echo "Not starting the workspace mount" + exit $_retval + fi fi -if [ $_retval -ne 0 ]; then - echo "The user has a directory named 'workspace' inside their home directory and it is not empty." - echo "Not starting the workspace mount" - exit -else - ln -s /home/${USER}/workspace $workspace_dir -fi + +ln -sf /home/${USER}/workspace $workspace_dir echo "Mount the workspace" su - "$USER" -c "/usr/bin/java -cp .:${workspace_dir}:${workspace_logdir}/ -Dlogback.configurationFile=${workspace_logdir}/logback.xml -jar $workspace_fuse_jar $SHINYPROXY_OIDC_ACCESS_TOKEN $workspace_dir" >/dev/null 2>&1 &