4371 shaares
Useful CLI when you have the RCON password of a Quake 3 server !
I have set up the script below as a cron job to alert me whenever a player connect to my friend server :
#!/bin/bash
set -o pipefail -o errexit -o nounset
cd $(dirname "${BASH_SOURCE[0]}")
date
echo status | quake3-rcon $server_address $rcon_password > quake3-kleph.status
grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' quake3-kleph.status | awk '{ print $4 }' > quake3-kleph.players
if ! diff -q quake3-kleph.players quake3-kleph.players.old; then
echo 'New player detected'
./send_reminder.sh "New player joined kleph.eu Quake3 server: $(comm -13 <(sort quake3-kleph.players.old) <(sort quake3-kleph.players) | tr '\n' ' ')"
fi
mv quake3-kleph.players quake3-kleph.players.old