For those who run etded servers inside of GNU screen on Linux, here’s a neat trick.
Install the following bash script in your PATH (e.g. /usr/local/sbin/etconsole):
#!/bin/bash
###############################################################################
# This script runs a command in the console of a etded.x86 process that is
# running in a screen.
#
# Edit the SCREEN_SEARCH variable to match your system
#
###############################################################################
SCREEN_SEARCH="SCREEN -d -m chroot /usr/local/enemy-territory su - et "
spid=`ps auxww | grep "${SCREEN_SEARCH}" | grep -v grep | awk '{print $2}'`;
cmd=$@$'\xA'
screen -S $spid -X stuff "$cmd"
You will then be able to send commands to the running etded console with the etconsole command. For example:
etconsole "say this is a test"
The above would be just like typing ‘say this is a test’ in your server console.
Note that you will most certainly need to change the SCREEN_SEARCH variable unless you’ve set up your et server exactly like I have (http://tjw.org/etded/)
The main reason I’ve set this up is so that I can automate certain server setting changes with cron (e.g. Panzer Free Friday).
Update: use /bin/bash instead of /bin/sh as interpreter.
:eek2: Thanks for keeping it real on your site and for all the usefull shrub admin/linux tips