From 44dde2e678c650812be445605d21168ceb81520a Mon Sep 17 00:00:00 2001 From: viennet Date: Sat, 2 Jan 2021 00:18:47 +0100 Subject: [PATCH] Avoid trying to delete depts when no config file --- scotests/scointeractive.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scotests/scointeractive.sh b/scotests/scointeractive.sh index 38bf8dfac..2cecaf90c 100755 --- a/scotests/scointeractive.sh +++ b/scotests/scointeractive.sh @@ -17,6 +17,7 @@ usage() { set -euo pipefail cd /opt/scodoc/Products/ScoDoc || exit 2 +source config/config.sh source config/utils.sh if [ $# -lt 1 ] @@ -38,7 +39,11 @@ shift if [ "$recreate_dept" = 1 ] then - (cd config || terminate "no config directory"; ./delete_dept.sh -n "$DEPT") || terminate "error deleting dept $DEPT" + cfg_pathname="${SCODOC_VAR_DIR}/config/depts/$DEPT".cfg + if [ -e "$cfg_pathname" ] + then + (cd config || terminate "no config directory"; ./delete_dept.sh -n "$DEPT") || terminate "error deleting dept $DEPT" + fi (cd config || terminate "no config directory"; ./create_dept.sh -n "$DEPT") || terminate "error creating dept $DEPT" # systemctl start scodoc fi