|
@ -3,7 +3,7 @@ |
|
|
# Server Management Script |
|
|
# Server Management Script |
|
|
# Author: Daniel Gibbs |
|
|
# Author: Daniel Gibbs |
|
|
# Website: http://danielgibbs.co.uk |
|
|
# Website: http://danielgibbs.co.uk |
|
|
# Version: 180813 |
|
|
# Version: 300813 |
|
|
|
|
|
|
|
|
#### Variables #### |
|
|
#### Variables #### |
|
|
|
|
|
|
|
@ -29,6 +29,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" |
|
|
# Server names |
|
|
# Server names |
|
|
servicename="kf-server" |
|
|
servicename="kf-server" |
|
|
gamename="Killing Floor" |
|
|
gamename="Killing Floor" |
|
|
|
|
|
engine="unreal2" |
|
|
ini="${servicename}.ini" |
|
|
ini="${servicename}.ini" |
|
|
servername=`grep -s ServerName= ${systemdir}/${ini} | sed 's/ServerName=//g'` |
|
|
servername=`grep -s ServerName= ${systemdir}/${ini} | sed 's/ServerName=//g'` |
|
|
|
|
|
|
|
@ -361,6 +362,64 @@ echo "Complete!" |
|
|
cd ${rootdir} |
|
|
cd ${rootdir} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn_details(){ |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "${gamename} Server Details" |
|
|
|
|
|
echo "============================" |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "${servername} Ports" |
|
|
|
|
|
echo "=======================" |
|
|
|
|
|
if [ "${engine}" = "unreal2" ];then |
|
|
|
|
|
gameport=$(grep Port= ${systemdir}/${ini}|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|sed 's/\Port=//g') |
|
|
|
|
|
queryport=$((${gameport} + 1)) |
|
|
|
|
|
gsqueryport=$(grep OldQueryPortNumber= ${systemdir}/${ini}|sed 's/\OldQueryPortNumber=//g') |
|
|
|
|
|
webadmin=$(grep ListenPort= ${systemdir}/${ini}|sed 's/\ListenPort=//g') |
|
|
|
|
|
webadminuser=$(grep AdminName= ${systemdir}/${ini}|sed 's/\AdminName=//g') |
|
|
|
|
|
webadminpass=$(grep AdminPassword= ${systemdir}/${ini}|sed 's/\AdminPassword=//g') |
|
|
|
|
|
echo "Ports the server is currently using" |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "DIRECTION DESCRIPTION PORT INI VARIABLE" |
|
|
|
|
|
echo "INBOUND Game Port ${gameport} Port=${gameport}" |
|
|
|
|
|
echo "INBOUND Query Port ${queryport} n/a" |
|
|
|
|
|
echo "INBOUND GameSpy Query Port ${gsqueryport} OldQueryPortNumber=${gsqueryport}" |
|
|
|
|
|
echo "OUTBOUND Master Server port 28900/28902 n/a" |
|
|
|
|
|
if [ "${appid}" ];then |
|
|
|
|
|
echo "OUTBOUND Steam Port 20660 n/a" |
|
|
|
|
|
fi |
|
|
|
|
|
echo "INBOUND: WebAdmin ${webadmin} ListenPort=${webadmin}" |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "${servername} WebAdmin" |
|
|
|
|
|
echo "=======================" |
|
|
|
|
|
echo "WebAdmin URL: http://localhost:${webadmin}" |
|
|
|
|
|
echo "WebAdmin Username: ${webadminuser}" |
|
|
|
|
|
echo "WebAdmin Password: ${webadminpass}" |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "Config file" |
|
|
|
|
|
echo "${systemdir}/${ini}" |
|
|
|
|
|
elif [ "${engine}" = "source" ];then |
|
|
|
|
|
servername=`grep -s hostname ${servercfg} | sed 's/hostname //g'|sed 's/"//g'` |
|
|
|
|
|
rcon=`grep -s rcon_password ${servercfg} | sed 's/rcon_password //g'|sed 's/"//g'` |
|
|
|
|
|
echo "Ports the server is currently using" |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "DIRECTION DESCRIPTION PORT" |
|
|
|
|
|
echo "INBOUND Game/Rcon Port ${port}" |
|
|
|
|
|
echo "INBOUND SourceTV Port ${sourcetvport}" |
|
|
|
|
|
echo "OUTBOUND Client Port ${clientport}" |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "You can change ports by editing the" |
|
|
|
|
|
echo "start parameters in ${selfname}" |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "${servername} Details" |
|
|
|
|
|
echo "=======================" |
|
|
|
|
|
echo "Server name: ${servername}" |
|
|
|
|
|
echo "Rcon Password: ${rcon}" |
|
|
|
|
|
echo "" |
|
|
|
|
|
echo "Config file:" |
|
|
|
|
|
echo "${servercfg}" |
|
|
|
|
|
fi |
|
|
|
|
|
echo "" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
# |
|
|
# |
|
|
##Installer |
|
|
##Installer |
|
|
# |
|
|
# |
|
@ -456,49 +515,42 @@ echo "=================================" |
|
|
* ) echo "Please answer yes or no.";; |
|
|
* ) echo "Please answer yes or no.";; |
|
|
esac |
|
|
esac |
|
|
done |
|
|
done |
|
|
echo "" |
|
|
fn_header |
|
|
echo "Configuring ${gamename} Server" |
|
|
echo "Configuring ${gamename} Server" |
|
|
echo "=================================" |
|
|
echo "=================================" |
|
|
sleep 1 |
|
|
|
|
|
echo "Copying ${systemdir}/default.ini to ${systemdir}/${ini}" |
|
|
echo "Copying ${systemdir}/default.ini to ${systemdir}/${ini}" |
|
|
cp ${systemdir}/Default.ini ${systemdir}/${ini} |
|
|
cp ${systemdir}/Default.ini ${systemdir}/${ini} |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
echo "" |
|
|
|
|
|
echo "Creating log directory" |
|
|
echo "Creating log directory" |
|
|
mkdir -v ${logdir} |
|
|
mkdir -v ${logdir} |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
echo "" |
|
|
|
|
|
echo "Applying WebAdmin ROOst.css fix!" |
|
|
echo "Applying WebAdmin ROOst.css fix!" |
|
|
echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" |
|
|
echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" |
|
|
sed -i 's/none}/none;/g' ${filesdir}/Web/ServerAdmin/ROOst.css |
|
|
sed -i 's/none}/none;/g' ${filesdir}/Web/ServerAdmin/ROOst.css |
|
|
sed -i 's/underline}/underline;/g' ${filesdir}/Web/ServerAdmin/ROOst.css |
|
|
sed -i 's/underline}/underline;/g' ${filesdir}/Web/ServerAdmin/ROOst.css |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
echo "" |
|
|
echo "Applying WebAdmin CharSet fix!" |
|
|
|
|
|
echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" |
|
|
|
|
|
sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' ${systemdir}/UWeb.int |
|
|
|
|
|
sleep 1 |
|
|
echo "Setting WebAdmin username and password" |
|
|
echo "Setting WebAdmin username and password" |
|
|
sed -i 's/AdminName=/AdminName=admin/g' ${systemdir}/${ini} |
|
|
sed -i 's/AdminName=/AdminName=admin/g' ${systemdir}/${ini} |
|
|
sed -i 's/AdminPassword=/AdminPassword=kfpass/g' ${systemdir}/${ini} |
|
|
sed -i 's/AdminPassword=/AdminPassword=kfpass/g' ${systemdir}/${ini} |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
echo "" |
|
|
|
|
|
echo "Enabling WebAdmin" |
|
|
echo "Enabling WebAdmin" |
|
|
sed -i 's/bEnabled=False/bEnabled=True/g' ${systemdir}/${ini} |
|
|
sed -i 's/bEnabled=False/bEnabled=True/g' ${systemdir}/${ini} |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
echo "" |
|
|
echo "Forcing server to start to get ports/server name to display correctly" |
|
|
cd ${rootdir} |
|
|
|
|
|
echo "Default Settings" |
|
|
|
|
|
echo "==============================" |
|
|
|
|
|
sleep 1 |
|
|
sleep 1 |
|
|
echo "WebAdmin Details:" |
|
|
cd ${rootdir} |
|
|
echo "Url: http://localhost:8075" |
|
|
${selfname} start |
|
|
echo "Username: admin" |
|
|
sleep 5 |
|
|
echo "Password: kfpass" |
|
|
${selfname} restart |
|
|
echo "" |
|
|
sleep 5 |
|
|
echo "Port Details:" |
|
|
${selfname} stop |
|
|
echo "8075 TCP (WebAdmin Port)" |
|
|
sleep 5 |
|
|
echo "7707 UDP (Game Port)" |
|
|
fn_header |
|
|
echo "7708 UDP (Query Port)" |
|
|
fn_details |
|
|
echo "7717 UDP (GameSpy Query Port)" |
|
|
|
|
|
echo "28852 TCP & UDP (Allows your Server to Connect to the Master Server Browser)" |
|
|
|
|
|
echo "20560 UDP (Steam Port)" |
|
|
|
|
|
echo "=================================" |
|
|
echo "=================================" |
|
|
echo "Install Complete!" |
|
|
echo "Install Complete!" |
|
|
echo "" |
|
|
echo "" |
|
@ -531,8 +583,10 @@ case "$1" in |
|
|
fn_steamguard;; |
|
|
fn_steamguard;; |
|
|
email-test) |
|
|
email-test) |
|
|
fn_emailtest;; |
|
|
fn_emailtest;; |
|
|
|
|
|
details) |
|
|
|
|
|
fn_details;; |
|
|
*) |
|
|
*) |
|
|
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|map-compressor|steam-auth|email-test}" |
|
|
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|map-compressor|steam-auth|email-test|details}" |
|
|
exit 1;; |
|
|
exit 1;; |
|
|
esac |
|
|
esac |
|
|
exit |
|
|
exit |