diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-02-18 12:31:32 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-07-01 18:02:28 +0200 |
commit | 316c81fa5da948744da8e0c6c5213eddbe25bf12 (patch) | |
tree | 29b115c8ee4db58e8035e162d36cd77bb1282c60 /install | |
parent | 43d8eca14c5974b4939dbf1b4e06aab0e5f613f0 (diff) | |
download | Ishtar-316c81fa5da948744da8e0c6c5213eddbe25bf12.tar.bz2 Ishtar-316c81fa5da948744da8e0c6c5213eddbe25bf12.zip |
Instance management scripts: fix evaluation of USE_*
Diffstat (limited to 'install')
-rwxr-xr-x | install/ishtar-delete-instance | 2 | ||||
-rwxr-xr-x | install/ishtar-prepare-instance | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/install/ishtar-delete-instance b/install/ishtar-delete-instance index c77ffaa34..a8b68b849 100755 --- a/install/ishtar-delete-instance +++ b/install/ishtar-delete-instance @@ -93,7 +93,7 @@ do_delete_instance() { dropuser "$DB_NAME" EOF - if [ -v $USE_CELERY ]; then + if [ $USE_CELERY = 'yes' ]; then systemctl disable celery-$INSTANCE systemctl stop celery-$INSTANCE /usr/sbin/rabbitmqctl delete_vhost /ishtar$INSTANCE diff --git a/install/ishtar-prepare-instance b/install/ishtar-prepare-instance index 098f1d486..b21ed7a0f 100755 --- a/install/ishtar-prepare-instance +++ b/install/ishtar-prepare-instance @@ -253,7 +253,7 @@ EOF # manage celery daemon CELERY_CONF="" - if [ -v $USE_CELERY ]; then + if [ $USE_CELERY == 'yes' ]; then RBMQ_PASSWORD=$(apg -a 0 -M ncl -n 1 -x 10 -m 10) /usr/sbin/rabbitmqctl add_vhost /ishtar$INSTANCE /usr/sbin/rabbitmqctl add_user ishtar$INSTANCE $RBMQ_PASSWORD @@ -269,15 +269,17 @@ EOF sed -s "s|example_project|$INSTANCE|g;" \ $INSTANCE"/celery_app.py.sample" > \ $INSTANCE"/celery_app.py" - sed -s "s|#APP_NAME#|$INSTANCE|g;" \ - "install/monit.template" > \ - "/etc/monit/conf-available/celery-"$INSTANCE + if [ -d "$DIRECTORY" ]; then + sed -s "s|#APP_NAME#|$INSTANCE|g;" \ + "install/monit.template" > \ + "/etc/monit/conf-available/celery-"$INSTANCE + fi systemctl daemon-reload fi ### __init__.py cd $INSTANCE - if [ -v $USE_CELERY ]; then + if [ $USE_CELERY = 'yes' ]; then ln -s __init__.py.celery.sample __init__.py else ln -s __init__.py.base.sample __init__.py @@ -302,11 +304,11 @@ EOF echo $CELERY_CONF >> "$INSTANCE/local_settings.py" - if [ -v $USE_CELERY ]; then + if [ $USE_CELERY = 'yes' ]; then echo "USE_BACKGROUND_TASK = True" >> "$INSTANCE/local_settings.py" fi - if [ -v $USE_LIBREOFFICE ]; then + if [ $USE_LIBREOFFICE = 'yes' ]; then echo "USE_LIBREOFFICE = True" >> "$INSTANCE/local_settings.py" fi @@ -381,7 +383,7 @@ EOF ### Celery - start worker - if [ -v $USE_CELERY ]; then + if [ $USE_CELERY = 'yes' ]; then systemctl enable celery-$INSTANCE systemctl start celery-$INSTANCE fi @@ -416,7 +418,7 @@ EOF echo " And then enjoy ishtar!" echo "" - if [ -v $USE_CELERY ]; then + if [ $USE_CELERY = 'yes' ]; then cat >&2 <<-'EOF' If you use monit a configuration file has been generated for the celery |