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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 13 deletions

View File

@ -1272,7 +1272,7 @@ function runChoice() {
preparePythonCommon
installRaScsiWebInterface
echo "Configuring RaSCSI Web Interface stand-alone - Complete!"
echo "Launch the Web Interface with the 'start.sh' script. To use a custom port for the web server: 'start.sh --port=8081"
echo "Launch the Web Interface with the 'start.sh' script. To use a custom port for the web server: 'start.sh --web-port=8081"
;;
12)
echo "Enabling authentication for the RaSCSI Web Interface"

View File

@ -1031,7 +1031,7 @@ if __name__ == "__main__":
)
parser.add_argument(
"--rascsi-port",
type=str,
type=int,
default=6868,
action="store",
help="RaSCSI port. Default: 6868",

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}