Add RASCSI host and port arguments to web/start.sh (#771)

* Fix data type of --rascsi-port argument

* Add support for --rascsi-host and --rascsi-port arguments

* Add short parameter names, increase specificity of web port parameter
This commit is contained in:
nucleogenic
2022-07-26 05:47:11 +01:00
committed by GitHub
parent 94c98b4577
commit dc1414ba71
3 changed files with 19 additions and 13 deletions

View File

@@ -90,16 +90,22 @@ while [ "$1" != "" ]; do
PARAM=$(echo "$1" | awk -F= '{print $1}')
VALUE=$(echo "$1" | awk -F= '{print $2}')
case $PARAM in
-p | --port)
PORT="--port $VALUE"
;;
-P | --password)
PASSWORD="--password $VALUE"
;;
*)
echo "ERROR: unknown parameter \"$PARAM\""
exit 1
;;
-p | --web-port)
ARG_PORT="--port $VALUE"
;;
-P | --password)
ARG_PASSWORD="--password $VALUE"
;;
-h | --rascsi-host)
ARG_RASCSI_HOST="--rascsi-host $VALUE"
;;
-o | --rascsi-port)
ARG_RASCSI_PORT="--rascsi-port $VALUE"
;;
*)
echo "ERROR: unknown parameter \"$PARAM\""
exit 1
;;
esac
shift
done
@@ -108,4 +114,4 @@ PYTHON_COMMON_PATH=$(dirname $PWD)/common/src
echo "Starting web server for RaSCSI Web Interface..."
export PYTHONPATH=$PWD/src:${PYTHON_COMMON_PATH}
cd src
python3 web.py ${PORT} ${PASSWORD}
python3 web.py ${ARG_PORT} ${ARG_PASSWORD} ${ARG_RASCSI_HOST} ${ARG_RASCSI_PORT}