Send screen command on a scripted server

For all the help you need with Armagetron!
Post Reply
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Send screen command on a scripted server

Post by dukevin »

I start my server with this script:

Code: Select all

#!/bin/sh

tron="/home/duke/aa/bin/armagetronad-dedicated"
var="/home/duke/aa/servers/demo/var/"
log="${var}console_log.txt"
userconfigdir="/home/duke/aa/servers/demo/var/customize/config/"
parser="/home/duke/aa/scripts/parser.php"
ladderlog="${var}ladderlog.txt"
cmds="${var}cmd.txt"
	
tail -n0 -f -s 0.01 $ladderlog | $parser | (while true; do $tron --userconfigdir $userconfigdir --vardir $var; done)| tee -a $log
(thanks jip)

However, I can no longer send commands to the server via GNU screen like I used to with

Code: Select all

screen -dmS $1 /home/duke/aa/scripts/srv $1
Any way to get this functionality back?
Image
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Send screen command on a scripted server

Post by dlh »

echo "say hi" >> $cmds

You can even make a fake server console…

Code: Select all

LOG_FILE=...
COMMANDS_FILE=...

# Display the log
tail -n0 -f "$LOG_FILE" &
trap "kill $!" EXIT

# Read input
while read -e line
do
    echo "$line" >> "$COMMANDS_FILE"
done
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Re: Send screen command on a scripted server

Post by dukevin »

That's very neat dlh, but I'm only using

tail -n0 -f -s 0.01 $ladderlog | $parser | (while true; do $tron --userconfigdir $userconfigdir --vardir $var; done)| tee -a $log

I have utilized the cmds file yet. Is there a way to do this without the cmds file?
Image
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Send screen command on a scripted server

Post by dlh »

Is there some issue with running the parser and server separately? (with parser writing to some commands file)
User avatar
dukevin
Round Winner
Posts: 219
Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:

Re: Send screen command on a scripted server

Post by dukevin »

Read the ct wiki and got this set up (2 screen sessions).

I'm tried the fake screen and it worked perfectly :) thanks
Image
Post Reply