#!/bin/sh 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 )" if (("$#" < 4)) || (("$#" > 6)); then echo "Usage: $0 [RTRR(default)|RR2] [--debug]" echo "Ex: $0 127.0.0.1 8899 rtrrpwd123 0" echo "Ex: $0 172.17.28.110 8899 rtrrpwd123 1" echo "Ex: $0 172.17.28.115 8899 rtrrpwd123 0 RTRR --debug" exit fi # --> set python3 env . $SCRIPT_DIR/set_py3_env.sh > /dev/null 2>&1 if [ -e "$HBS_INST_PATH/rr2/bin/cli_get_remote_share_dirs.pyc" ]; then PY_ENTRY="$HBS_INST_PATH/rr2/bin/cli_get_remote_share_dirs.pyc" else PY_ENTRY="$HBS_INST_PATH/rr2/bin/cli_get_remote_share_dirs.py" fi SERVER_HOST=$1 SERVER_PORT=$2 SERVER_PLAIN_PWD=$3 SSL_STR= if [ $4 == "True" ] || [ $4 == "true" ] || [ $4 == "1" ]; then SSL_STR=--ssl fi FILTER=RTRR if (("$#" > 4)); then if [ $5 == "RR2" ] || [ $5 == "rr2" ]; then FILTER=RR2 fi fi # FILTER=RR2 # if (("$#" > 4)); then # if [ $5 == "RTRR" ] || [ $5 == "rtrr" ]; then # FILTER=RTRR # fi # fi DEBUG_STR= for arg in $* do if [ $arg == "--debug" ]; then DEBUG_STR=--debug echo "*** DEBUG MODE" break fi done if [ "$DEBUG_STR" = "--debug" ]; then echo "python3 $PY_ENTRY -host $SERVER_HOST -port $SERVER_PORT -pwd_plain $SERVER_PLAIN_PWD --filter $FILTER $SSL_STR $DEBUG_STR" fi python3 $PY_ENTRY -host $SERVER_HOST -port $SERVER_PORT -pwd_plain $SERVER_PLAIN_PWD --filter $FILTER $SSL_STR $DEBUG_STR # for i in {1..50} # do # echo "-----------> test #$i" # python3 $PY_ENTRY -host $SERVER_HOST -port $SERVER_PORT -pwd_plain $SERVER_PLAIN_PWD --filter $FILTER $SSL_STR $DEBUG_STR # done exit 0