Ansible-Zammad/roles/zammad/templates/ingest-attachment-fix.sh.j2
2023-04-04 15:33:23 -06:00

15 lines
625 B
Django/Jinja

#!/bin/bash
date | tee -a /var/log/zammad/ingest.log
if systemctl is-failed --quiet elasticsearch; then
echo Elastic Search is failed | tee -a /var/log/zammad/ingest.log
if tail --line=20 /var/log/elasticsearch/elasticsearch.log | grep "Plugin \[ingest-attachment\] was built for Elasticsearch version"; then
echo Ingest-Attachment needs to be reinstalled | tee -a /var/log/zammad/ingest.log
/usr/share/elasticsearch/bin/elasticsearch-plugin remove ingest-attachment
sleep 10
/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment --batch
systemctl start elasticsearch
fi
fi