Alloc, if I want to "nice" the server so it runs at higher priority, what would be the best way to do that using your scripts?
UPDATE: I ended up slapping this together and having cron run it every 15 minutes...seems to work, but my bash scripting is pretty bad.
#!/bin/bash
############################################################################
# 7DTD Renice Script by The Hated Crew #
# Call with cron on an interval you choose. #
# Script must be run as root user. #
############################################################################
SDTDPIDFILE=/opt/sdtd/instances/THC/7dtd.pid
SDTDNICEVALUE=-15
#Check to see if the PID file exists, if so, read PID into $sdtdpid variable.
if [ -f $SDTDPIDFILE ]; then
sdtdpid=$(cat $SDTDPIDFILE)
#Check to make sure the PID is actually running, if so, capture nice value of PID.
if [ -e /proc/$sdtdpid ]; then
sdtdniceval=$(ps --no-heading -p $sdtdpid -o "ni")
#If nice value isn't set then run the renice command.
if [ $sdtdniceval -ne $SDTDNICEVALUE ]; then
renice -n $SDTDNICEVALUE -p $sdtdpid
fi
else
echo "7DTD server PID file exists but server isn't running."
fi
else
echo "7DTD PID file doesn't exist, so server is probably not running."
fi