Update script
This commit is contained in:
parent
8f22be6f99
commit
889924fee4
1 changed files with 10 additions and 8 deletions
|
@ -1,22 +1,24 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# {{ ansible_managed }}
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
OPENSEARCH_BIN_PATH=/usr/share/opensearch/bin
|
OPENSEARCH_BIN_PATH=/usr/share/opensearch/bin
|
||||||
OPENSEARCH_SERVICE=opensearch.service
|
OPENSEARCH_SERVICE=opensearch.service
|
||||||
PLUGINS=(
|
|
||||||
ingest-attachment
|
|
||||||
)
|
|
||||||
|
|
||||||
ACTION="${1:-help}"
|
ACTION="${1:-help}"
|
||||||
|
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
purge)
|
purge)
|
||||||
for plugin in "${PLUGINS[@]}"; do
|
PLUGINS=$($OPENSEARCH_BIN_PATH/opensearch-plugin list | grep -v opensearch-)
|
||||||
$OPENSEARCH_BIN_PATH/opensearch-plugin remove $plugin --batch
|
if [[ -z "$PLUGINS" ]]; then
|
||||||
done
|
exit 0
|
||||||
systemctl restart $OPENSEARCH_SERVICE
|
else
|
||||||
|
for plugin in "${PLUGINS[@]}"; do
|
||||||
|
$OPENSEARCH_BIN_PATH/opensearch-plugin remove $plugin
|
||||||
|
done
|
||||||
|
systemctl restart $OPENSEARCH_SERVICE
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
install)
|
install)
|
||||||
for plugin in "${PLUGINS[@]}"; do
|
for plugin in "${PLUGINS[@]}"; do
|
||||||
|
|
Loading…
Reference in a new issue