I'm basically setting up a dayz arma server on linux. I wrote a perl script to read the output from the server and interact with a mysql database.
I've tested the perl script by passing it typical output saved in a text file.
hive.pl < hive.test
The perl portion works fine.
Here is my problem. No matter how I try this from a shell script, I can't get the perl script to start and read the output (no errors). Here is the basics of what I've got.
ARMA_DIR=/home/dayz/chernarus_server
LOGFILE=${ARMA_DIR}/log.${PORT}.txt
HIVE=${ARMA_DIR}/linux/hive.pl
SERVER=${ARMA_DIR}/server
${SERVER} 2>&1 | tee ${HIVE} ${LOGFILE}
I don't really need the tee to the logfile, I could just go to the perl file. However, I added this just to make sure of what was coming out.
I'm using something like the following inside the perl file to read. (left out all the actions inside while)
while (<STDIN>) {
}
Any guidance?