Created
January 21, 2019 11:47
-
-
Save kokosing/9b8a0b16398792ad137fe3f5ef8000a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -xeuo pipefail | |
usage() | |
{ | |
echo "Usage: $0 -p <path of configs to be overriden>" >&2 | |
exit 1 | |
} | |
wget -O /tmp/common.sh -q https://prestostoregen1.blob.core.windows.net/override/common.sh | |
. /tmp/common.sh | |
rm -f /tmp/common.sh | |
wget -O /tmp/presto_config_override.py -q https://starburstdata.blob.core.windows.net/presto/presto_config_override.py | |
declare override_config="" | |
declare config_dir="/${server_tarball_filename}/etc/" | |
if [ ! -d "${config_dir}" ]; then | |
echo "[Error] Presto not installed/configured. You cannot modify configuration before installing Presto. Exiting!" >&2 | |
exit 1 | |
fi | |
# Initialize parameters specified from command line | |
while getopts ":p:" arg; do | |
case "${arg}" in | |
p) | |
override_config=${OPTARG} | |
;; | |
esac | |
done | |
shift $((OPTIND-1)) | |
if [[ -z "$override_config" ]]; then | |
echo "Parameter override_config is missing." >&2 | |
usage | |
fi | |
setup_python36 | |
python3.6 /tmp/presto_config_override.py $config_dir $override_config | |
rm -f /tmp/presto_config_override.py | |
if is_presto_node; then | |
sudo -u presto "${server_tarball_filename}/bin/launcher" restart | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment