qlpycon/qlpycon.bash
2026-01-09 13:40:59 +01:00

55 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Helper script to connect to different Quake Live servers
# Set QLPYCON_PASSWORD environment variable or create ~/.qlpycon.conf
workdir="${QLPYCON_WORKDIR:-/home/marc/git/qlpycon}"
password="${QLPYCON_PASSWORD:-}"
serverip="10.13.12.93"
# Check if password is set
if [ -z "$password" ]; then
echo "Error: QLPYCON_PASSWORD environment variable not set"
echo "Set it with: export QLPYCON_PASSWORD='your_password'"
echo "Or create ~/.qlpycon.conf with [connection] section"
exit 1
fi
cd "$workdir"
source venv/bin/activate
if [ "$1" == "ffa" ]; then
python3 main.py --host tcp://"$serverip":28960 --password "$password"
elif [ "$1" == "duel" ]; then
python3 main.py --host tcp://"$serverip":28961 --password "$password"
elif [ "$1" == "rcpma" ]; then
python3 main.py --host tcp://"$serverip":28962 --password "$password"
elif [ "$1" == "iffa" ]; then
python3 main.py --host tcp://"$serverip":28963 --password "$password"
elif [ "$1" == "ca" ]; then
python3 main.py --host tcp://"$serverip":28964 --password "$password"
elif [ "$1" == "ctf" ]; then
python3 main.py --host tcp://"$serverip":28965 --password "$password"
elif [ "$1" == "rcvq3" ]; then
python3 main.py --host tcp://"$serverip":28966 --password "$password"
elif [ "$1" == "test" ]; then
python3 main.py --host tcp://"$serverip":28967 --password "$password"
elif [ "$1" == "ft" ]; then
python3 main.py --host tcp://"$serverip":28968 --password "$password"
elif [ "$1" == "leduel" ]; then
python3 main.py --host tcp://"$serverip":28969 --password "$password"
else
echo "[ ffa (27960), duel (27961), rcpma (27962), iffa (27963), ca (27964), ctf (27965), rcvq3 (27966), test (27967), ft (27968), leduel (27969) ]"
fi