aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--start.ps11
-rwxr-xr-xstart.sh8
2 files changed, 8 insertions, 1 deletions
diff --git a/start.ps1 b/start.ps1
index a6f26dc..4927da6 100644
--- a/start.ps1
+++ b/start.ps1
@@ -3,6 +3,7 @@ param (
[Parameter(Mandatory=$true)][int]$w,
[switch]$h
)
+$w--
if ($h) {
Write-Output "Usage:"
Write-Output "-s (Server port)"
diff --git a/start.sh b/start.sh
index c7560e5..0414224 100755
--- a/start.sh
+++ b/start.sh
@@ -2,19 +2,25 @@
#Bash script for automating evaluate
echo "Dots and Boxes Agent Shell Script: Ver 1.0RC2: adding options"
-while getopts 'w:p:h:' opt; do
+while getopts ':w:p:h:' opt; do
case $opt in
w) WEB=$OPTARG;;
p) PORT=$OPTARG;;
h) echo "Usage: ./start.sh -w (web port) -p (starting agent port)"
exit 0;;
+ \?)
+ echo "Invalid option: -$OPTARG" >&2
+ echo "Usage: ./start.sh -w (web port) -p (starting agent port)"
+ exit 1;;
*) echo "Usage: ./start.sh -w (web port) -p (starting agent port)"
exit 1;;
+
esac
done
(python3 python/dotsandboxes/dotsandboxesserver.py $WEB) >> server.log &
echo "Web server running on http://127.0.0.1:$WEB"
+PORT=`expr $PORT - 1`;
for a in 1 2
do