From 88b7137ba594fc163b47656e9c12ba1d5d7a4765 Mon Sep 17 00:00:00 2001 From: Dimitris Papagiannis Date: Wed, 26 Jun 2024 09:54:13 +0200 Subject: [PATCH] Change the order of preliminary checks --- deploy_dqmgui.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/deploy_dqmgui.sh b/deploy_dqmgui.sh index 3c95f05..cc213ea 100755 --- a/deploy_dqmgui.sh +++ b/deploy_dqmgui.sh @@ -77,18 +77,6 @@ preliminary_checks() { exit 1 fi - # Stop GUI if already running - if [ -f "${INSTALLATION_DIR:?}/current/config/dqmgui/manage" ] && - [ -f "$INSTALLATION_DIR/current/apps/dqmgui/128/etc/profile.d/env.sh" ]; then - $INSTALLATION_DIR/current/config/dqmgui/manage stop 'I did read documentation' - fi - - # Delete installation (config & sw, does not delete state) - if [ -d "${INSTALLATION_DIR:?}/${DMWM_GIT_TAG:?}" ]; then - echo "WARNING: $INSTALLATION_DIR/$DMWM_GIT_TAG exists, deleting contents (except auth)" - find "${INSTALLATION_DIR:?}/${DMWM_GIT_TAG:?}/" -maxdepth 1 -mindepth 1 -type d ! -path . ! -name auth -exec rm -rf {} \; - fi - if [ -n "$DMWM_PRS" ]; then # If there are PRs to apply, check if patch is available locally if ! command -v patch >/dev/null; then @@ -118,6 +106,19 @@ preliminary_checks() { done IFS=$OLD_IFS fi + + # Stop GUI if already running + if [ -f "${INSTALLATION_DIR:?}/current/config/dqmgui/manage" ] && + [ -f "$INSTALLATION_DIR/current/apps/dqmgui/128/etc/profile.d/env.sh" ]; then + $INSTALLATION_DIR/current/config/dqmgui/manage stop 'I did read documentation' + fi + + # Delete installation (config & sw, does not delete state) + if [ -d "${INSTALLATION_DIR:?}/${DMWM_GIT_TAG:?}" ]; then + echo "WARNING: $INSTALLATION_DIR/$DMWM_GIT_TAG exists, deleting contents (except auth)" + find "${INSTALLATION_DIR:?}/${DMWM_GIT_TAG:?}/" -maxdepth 1 -mindepth 1 -type d ! -path . ! -name auth -exec rm -rf {} \; + fi + } # Check for needed OS-wide dependencies check_dependencies() {