forked from wazuh/wazuh-docker
Added WAZUH_KIBANA_PLUGIN_URL variable to wait-for-it.sh so that kibana plugin installation URL can be overwritten (the default still points to https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.3.0.zip). This is useful in (most likely corporate) environments where there is no egress to the internet or users just prefer to mirror all software locally. Could also be useful to test a different version of the plugin.
26 lines
505 B
Bash
26 lines
505 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
host="$1"
|
|
shift
|
|
cmd="kibana"
|
|
WAZUH_KIBANA_PLUGIN_URL=${WAZUH_KIBANA_PLUGIN_URL:-https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.3.0.zip}
|
|
|
|
until curl -XGET $host:9200; do
|
|
>&2 echo "Elastic is unavailable - sleeping"
|
|
sleep 1
|
|
done
|
|
|
|
sleep 30
|
|
|
|
>&2 echo "Elastic is up - executing command"
|
|
|
|
if /usr/share/kibana/bin/kibana-plugin list | grep wazuh; then
|
|
echo "Wazuh APP already installed"
|
|
else
|
|
/usr/share/kibana/bin/kibana-plugin install ${WAZUH_KIBANA_PLUGIN_URL}
|
|
fi
|
|
|
|
exec $cmd
|