Skip to content

Instantly share code, notes, and snippets.

@MChorfa
Last active June 15, 2020 17:00
Show Gist options
  • Save MChorfa/c132fd4acc54af6031311f159c528349 to your computer and use it in GitHub Desktop.
Save MChorfa/c132fd4acc54af6031311f159c528349 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
#######################################
# Arguments:
# - Password
#######################################
function hash_es_password() {
local ODES_PASS_PLAIN=$1
local ODES_DOCKER_UUID=$(docker run --rm -d amazon/opendistro-for-elasticsearch)
local ODES_PASS_HASH=$(docker exec ${ODES_DOCKER_UUID} /bin/sh /usr/share/elasticsearch/plugins/opendistro_security/tools/hash.sh -p ${ODES_PASS_PLAIN})
echo "${ODES_PASS_HASH}"
}
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment