#!/bin/sh # --> get the dir of this script SOURCE="${BASH_SOURCE[0]}" # resolve $SOURCE until the file is no longer a symlink while [ -h "$SOURCE" ]; do DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it # relative to the path where the symlink file was located done SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )" # --> set python3 env . $SCRIPT_DIR/../set_py3_env.sh > /dev/null 2>&1 # --> copy the current src to local QPKG . $SCRIPT_DIR/../../test/common/copy_and_setup_args.sh "$@" # --> print usage if [ $REAL_ARGNO -lt 3 ]; then echo "Usage: $0 remote_ip plain_pwd tmp_dst_dir [--debug]" echo "Ex: $0 172.17.28.115 rtrrpwd123 /share/Public/tmp/rtrr_rr2" echo "" exit fi # --> init vars HOSTIP=$1 PLAINPWD=$2 ACT=update_hbs_rr2 ACT_ARGS="{\"tmp_dst_dir\":\"$3\"}" PORT=8080 WAY=-http # --> count the time elapsed SECONDS=0 # ------------- major script start echo "----> (http) update hbs rr2" $HBS_INST_PATH/rr2/scripts/remote_run.sh -host $HOSTIP -plainpwd $PLAINPWD $WAY $ACT -actargs "$ACT_ARGS" --port $PORT $DEBUG_ARG # ------------- major script end duration=$SECONDS if [ $DEBUG -eq 1 ]; then set +x echo "--> $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." fi exit 0