mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-30 07:59:40 -08:00
30 lines
749 B
Bash
Executable file
30 lines
749 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# If either of the two tests below fail, you may need to install GNU coreutils
|
|
# in your environment.
|
|
|
|
if [ ! -x "$(which readlink)" ]; then
|
|
echo "readlink tool cannot be found." > /dev/stderr
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -x "$(which dirname)" ]; then
|
|
echo "dirname tool cannot be found." > /dev/stderr
|
|
exit 1
|
|
fi
|
|
|
|
readonly binary="${0}"
|
|
readonly binary_path="$(readlink -f ${binary})"
|
|
readonly binary_directory="$(dirname ${binary_path})"
|
|
|
|
readonly platform=$(uname | tr '[:upper:]' '[:lower:]')
|
|
|
|
|
|
export LD_LIBRARY_PATH="${binary_directory}/lib:${LD_LIBRARY_PATH}"
|
|
|
|
if [[ "${platform}" == "darwin" ]]; then
|
|
export DYLD_LIBRARY_PATH="${binary_directory}/lib:${DYLD_LIBRARY_PATH}"
|
|
fi
|
|
|
|
exec "${binary_directory}/prometheus" "${@}"
|