prometheus/.build/package/run_prometheus.sh

30 lines
746 B
Bash
Raw Normal View History

2013-06-12 15:46:43 +00:00
#!/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})"
2013-06-24 11:13:58 +00:00
readonly platform=$(uname | tr '[:upper:]' '[:lower:]')
export LD_LIBRARY_PATH="${binary_directory}/lib:${LD_LIBRARY_PATH}"
2013-06-12 15:46:43 +00:00
2013-06-24 11:13:58 +00:00
if [[ "${platform}" == "darwin" ]]; then
2013-06-12 15:46:43 +00:00
export DYLD_LIBRARY_PATH="${binary_directory}/lib:${DYLD_LIBRARY_PATH}"
fi
"${binary_directory}/prometheus" "${@}" &