forked from ScoDoc/ScoDoc
Avoid trying to delete depts when no config file
This commit is contained in:
parent
e2a2b0f083
commit
44dde2e678
@ -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 ]
|
||||
@ -37,8 +38,12 @@ DEPT="$1"
|
||||
shift
|
||||
|
||||
if [ "$recreate_dept" = 1 ]
|
||||
then
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user