-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.sh
executable file
·45 lines (40 loc) · 990 Bytes
/
client.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
python3 -m venv env
source env/bin/activate
python3 -m pip install -r game/requirements.txt
cd ../cheats-rust
maturin build --profile opt -i "$(which python3)"
pip install --force-reinstall target/wheels/*
cd ../game
if [ "$1" = "local" ]; then
hostname="localhost"
certpath="../ca/team6"
capath="../ca/CA-devel.crt"
standalone=""
export GAME_LOCAL="t"
elif [ "$1" = "remote" ]; then
hostname="team6.hackceler8-2023.ctfcompetition.com"
certpath="$HOME/team6"
capath="$HOME/ca.crt"
standalone=""
elif [ "$1" = "standalone" ]; then
hostname=""
certpath=""
capath=""
standalone="--standalone"
export GAME_LOCAL="t"
else
echo "Specify local/remote/standalone as first argument"
exit 1
fi
if [ "$2" = "plain" ]; then
export GAME_SSL="f"
elif [ "$2" = "ssl" ]; then
export GAME_SSL="t"
else
echo "Specify plain/ssl as second argument"
exit 1
fi
cd game
python3 client.py --ca="$capath" $standalone "$hostname" 8888 8889 "$certpath"