Define plugin list
This commit is contained in:
parent
8f30abee4f
commit
982522ca8e
3 changed files with 18 additions and 11 deletions
|
@ -5,20 +5,23 @@ set -eu
|
|||
|
||||
OPENSEARCH_BIN_PATH=/usr/share/opensearch/bin
|
||||
OPENSEARCH_SERVICE=opensearch.service
|
||||
PLUGINS=(
|
||||
{% for plugin in opensearch_plugins %}
|
||||
{% if not loop.last %}
|
||||
{{ plugin }}
|
||||
{% else %}
|
||||
{{ plugin }})
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
ACTION="${1:-help}"
|
||||
|
||||
case "$ACTION" in
|
||||
purge)
|
||||
PLUGINS=$($OPENSEARCH_BIN_PATH/opensearch-plugin list | grep -v opensearch- || true)
|
||||
if [[ -z "$PLUGINS" ]]; then
|
||||
exit 0
|
||||
else
|
||||
for plugin in "${PLUGINS[@]}"; do
|
||||
$OPENSEARCH_BIN_PATH/opensearch-plugin remove $plugin
|
||||
done
|
||||
systemctl restart $OPENSEARCH_SERVICE
|
||||
fi
|
||||
for plugin in "${PLUGINS[@]}"; do
|
||||
$OPENSEARCH_BIN_PATH/opensearch-plugin remove $plugin
|
||||
done
|
||||
systemctl restart $OPENSEARCH_SERVICE
|
||||
;;
|
||||
install)
|
||||
for plugin in "${PLUGINS[@]}"; do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue