From f6129ad8f90ec1a2b4f3e6eff4444aa735fc52bc Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sat, 21 Nov 2020 21:47:10 -0500 Subject: [PATCH] update docs --- bin/bpatch | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/bpatch b/bin/bpatch index 188eb07d..e8d00b58 100755 --- a/bin/bpatch +++ b/bin/bpatch @@ -27,6 +27,10 @@ SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd) HOST=${1:?no host provided} NO_RESTART=${2} +if [[ -z "$(echo "${HOST}" | tr -cd '[:alnum:].-')" ]] ; then + die "invalid host: ${HOST}" +fi + BUBBLE_SERVER_DIR="${SCRIPT_DIR}/../bubble-server" if [[ ! -d "${BUBBLE_SERVER_DIR}" ]] ; then die "bubble-server dir not found: ${BUBBLE_SERVER_DIR}" @@ -36,9 +40,9 @@ cd ${BUBBLE_SERVER_DIR} mvn -DskipTests=true -Dcheckstyle.skip=true compile && rsync -avzc ./target/classes ${HOST}:/tmp/ | egrep -v '*/$' || die "Error recompiling classes" if [[ ! -z "${NO_RESTART}" && "${NO_RESTART}" == "norestart" ]] ; then - echo "Patching but not restarting..." + echo "Patching but not restarting: ${HOST} ..." ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cd /tmp && cp ~bubble/api/bubble.jar . && cd classes && jar uvf ../bubble.jar . | egrep -v '*/\(*' && cat ../bubble.jar > ~bubble/api/bubble.jar" || die "Error patching remote jar" else - echo "Patching and restarting..." + echo "Patching and restarting: ${HOST} ..." ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cd /tmp && cp ~bubble/api/bubble.jar . && cd classes && jar uvf ../bubble.jar . | egrep -v '*/\(*' && cat ../bubble.jar > ~bubble/api/bubble.jar && supervisorctl restart bubble" || die "Error patching remote jar" fi