Browse Source
Removed the old functions that are no longer required. This may cause issues with older script version. If you experience and issue please updatepull/292/head
43 changed files with 0 additions and 1963 deletions
@ -1,28 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_autoip function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: Identifies the server interface IP. |
|||
# If multiple interfaces this will need to be set manually. |
|||
|
|||
if [ ! -f /bin/ip ]; then |
|||
ipcommand="/sbin/ip" |
|||
else |
|||
ipcommand="ip" |
|||
fi |
|||
getip=$(${ipcommand} -o -4 addr|awk '{print $4 }'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0) |
|||
getipwc=$(${ipcommand} -o -4 addr|awk '{print $4 }'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0) |
|||
|
|||
if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then |
|||
if [ "${getipwc}" -ge "2" ]; then |
|||
fn_printwarn "Multiple active network interfaces found.\n\n" |
|||
echo -en "Manually specify the IP you want to use within the ${selfname} script.\n" |
|||
echo -en "Set ip=\"0.0.0.0\" to one of the following:\n" |
|||
echo -en "${getip}\n" |
|||
exit |
|||
else |
|||
ip=${getip} |
|||
fi |
|||
fi |
@ -1,61 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_backupserver function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: Creates a .tar.gz file in the backup directory. |
|||
|
|||
local modulename="Backup" |
|||
fn_rootcheck |
|||
fn_syscheck |
|||
backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')" |
|||
echo "" |
|||
echo "${gamename} Backup" |
|||
echo "============================" |
|||
echo "" |
|||
echo "The following backup will be created:" |
|||
echo "" |
|||
echo "${backupdir}/${backupname}.tar.gz" |
|||
echo "" |
|||
while true; do |
|||
read -p "Continue? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) echo Exiting; return 1;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") |
|||
if [ "${tmuxwc}" -eq 1 ]; then |
|||
echo "" |
|||
fn_printwarningnl "${servicename} is currently running." |
|||
sleep 1 |
|||
while true; do |
|||
read -p "Stop ${servicename} while running the backup? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) fn_stopserver; break;; |
|||
[Nn]* ) break;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
fi |
|||
fn_scriptlog "Started" |
|||
echo -en "starting backup.\r" |
|||
sleep 1 |
|||
echo -en "starting backup..\r" |
|||
sleep 1 |
|||
echo -en "starting backup...\r" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
cd "${rootdir}" |
|||
mkdir -pv "${backupdir}" > /dev/null 2>&1 |
|||
tar -cvzf "${backupdir}/${backupname}.tar.gz" --exclude "${backupdir}" ./* |
|||
echo "" |
|||
echo "Backup created: ${backupdir}/${backupname}.tar.gz" |
|||
fn_scriptlog "Created: ${backupdir}/${backupname}.tar.gz" |
|||
sleep 1 |
|||
echo "" |
|||
fn_printcompletenl "Complete." |
|||
fn_scriptlog "Complete" |
|||
echo "" |
@ -1,59 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_debugserver function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 140115 |
|||
|
|||
# Description: Runs the server without tmux. Runs direct from the terminal. |
|||
|
|||
local modulename="Debug" |
|||
fn_rootcheck |
|||
fn_syscheck |
|||
fn_autoip |
|||
fn_distrodetails |
|||
fn_parms |
|||
echo "" |
|||
echo "${gamename} Debug" |
|||
echo "============================" |
|||
echo "" |
|||
echo -e "Distro: ${os}" |
|||
echo -e "Arch: ${arch}" |
|||
echo -e "Kernel: ${kernel}" |
|||
echo -e "Hostname: $HOSTNAME" |
|||
echo "" |
|||
echo "Start parameters:" |
|||
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|||
echo "${executable} ${parms} -debug" |
|||
else |
|||
echo "${executable} ${parms}" |
|||
fi |
|||
echo "" |
|||
echo -e "Use for identifying server issues only!" |
|||
echo -e "Press CTRL+c to drop out of debug mode." |
|||
fn_printwarningnl "If ${servicename} is already running it will be stopped." |
|||
echo "" |
|||
while true; do |
|||
read -p "Continue? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) echo Exiting; return 1;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
fn_scriptlog "Starting debug" |
|||
fn_printinfonl "Stopping any running servers" |
|||
fn_scriptlog "Stopping any running servers" |
|||
sleep 1 |
|||
fn_stopserver |
|||
fn_printdots "Starting debug" |
|||
sleep 1 |
|||
fn_printok "Starting debug" |
|||
fn_scriptlog "Started debug" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
cd "${executabledir}" |
|||
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|||
${executable} ${parms} -debug |
|||
else |
|||
${executable} ${parms} |
|||
fi |
@ -1,18 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_distro function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 141214 |
|||
# Depricated: fn_distrodetails has replaced this function. |
|||
|
|||
arch=$(uname -m) |
|||
kernel=$(uname -r) |
|||
if [ -f /etc/lsb-release ]; then |
|||
os=$(lsb_release -s -d) |
|||
elif [ -f /etc/debian_version ]; then |
|||
os="Debian $(cat /etc/debian_version)" |
|||
elif [ -f /etc/redhat-release ]; then |
|||
os=$(cat /etc/redhat-release) |
|||
else |
|||
os="$(uname -s) $(uname -r)" |
|||
fi |
@ -1,90 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_distrodetails function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 141214 |
|||
|
|||
# Description: Variables providing useful info on the Operating System such as disk and performace info. |
|||
# Used for fn_details, fn_debugserver and fn_emailnotification. |
|||
|
|||
## Distro infomation |
|||
# Returns architecture, kernel and distro/os. |
|||
arch=$(uname -m) |
|||
kernel=$(uname -r) |
|||
if [ -f /etc/lsb-release ]; then |
|||
os=$(lsb_release -s -d) |
|||
elif [ -f /etc/debian_version ]; then |
|||
os="Debian $(cat /etc/debian_version)" |
|||
elif [ -f /etc/redhat-release ]; then |
|||
os=$(cat /etc/redhat-release) |
|||
else |
|||
os="$(uname -s) $(uname -r)" |
|||
fi |
|||
|
|||
# Glibc version number |
|||
# e.g: 1.17 |
|||
glibcv=$(ldd --version |grep ldd|awk '{print $NF}') |
|||
|
|||
# tmux version |
|||
# e.g: tmux 1.6 |
|||
if [ -z $(command -v tmux) ]; then |
|||
tmuxv="\e[0;31mNOT INSTALLED!\e[0m" |
|||
elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd [:digit:]|tail -c 3)" -lt "16" ]; then |
|||
tmuxv="$(tmux -V) (>= 1.6 required for console log)" |
|||
else |
|||
tmuxv=$(tmux -V) |
|||
fi |
|||
|
|||
## Performance |
|||
|
|||
# Average server load |
|||
load=$(uptime|awk -F 'load average: ' '{ print $2 }') |
|||
|
|||
# Memory |
|||
|
|||
# Older versions of free do not support -h option. |
|||
if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then |
|||
option="-m" |
|||
else |
|||
option="-h" |
|||
fi |
|||
physmemtotal=$(free ${option} | awk '/Mem:/ {print $2}') |
|||
physmemused=$(free ${option} | awk '/Mem:/ {print $3}') |
|||
physmemfree=$(free ${option} | awk '/Mem:/ {print $4}') |
|||
swaptotal=$(free ${option} | | awk '/Swap:/ {print $2}') |
|||
swapused=$(free ${option} | awk '/Swap:/ {print $3}') |
|||
swapfree=$(free ${option} | awk '/Swap:/ {print $4}') |
|||
|
|||
# Uptime |
|||
uptime=$(</proc/uptime) |
|||
uptime=${uptime%%.*} |
|||
minutes=$(( uptime/60%60 )) |
|||
hours=$(( uptime/60/60%24 )) |
|||
days=$(( uptime/60/60/24 )) |
|||
|
|||
# Disk usage |
|||
# available space on the partition. |
|||
availspace=$(df -hP ${rootdir} | grep -v "Filesystem" | awk '{print $4}') |
|||
# used space in serverfiles dir. |
|||
serverfilesdu=$(du -sh ${serverfiles} | awk '{print $1}') |
|||
if [ -z ${serverfilesdu} ]; then |
|||
serverfilesdu="0M" |
|||
fi |
|||
|
|||
# Backup info |
|||
if [ -d "${backupdir}" ]; then |
|||
# used space in backups dir. |
|||
backupdirdu=$(du -sh ${backupdir} | awk '{print $1}') |
|||
if [ -z ${backupdirdu} ]; then |
|||
backupdirdu="0M" |
|||
fi |
|||
# number of backups. |
|||
backupcount=$(find "${backupdir}"/*.tar.gz | wc -l) |
|||
# most recent backup. |
|||
lastbackup=$(ls -t "${backupdir}"/*.tar.gz | head -1) |
|||
# date of most recent backup. |
|||
lastbackupdate=$(date -r ${lastbackup}) |
|||
# size of most recent backup. |
|||
lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}') |
|||
|
|||
fi |
@ -1,43 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_emailnotification function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 150115 |
|||
|
|||
# Description: Sends email notification if monitor picks up a failure. |
|||
|
|||
local modulename="Email" |
|||
fn_printdots "Sending notification to ${email}" |
|||
fn_distrodetails |
|||
{ |
|||
echo -e "========================================\n${servicename} details\n========================================\n" |
|||
echo -e "Service: ${servicename}" |
|||
echo -e "Server: ${servername}" |
|||
echo -e "Game: ${gamename}" |
|||
echo -e "Failure reason: ${failurereason}" |
|||
echo -e "Action Taken: ${actiontaken}\n" |
|||
echo -e "========================================\nServer details\n========================================\n" |
|||
echo -e "Date: $(date)" |
|||
echo -e "Distro: ${os}" |
|||
echo -e "Arch: ${arch}" |
|||
echo -e "Kernel: ${kernel}" |
|||
echo -e "Hostname: $HOSTNAME" |
|||
echo -e "Uptime: ${days}d, ${hours}h, ${minutes}m" |
|||
echo -e "Avg Load${load}\n" |
|||
echo -e "========================================\nLogs\n========================================\n" |
|||
echo -e "Script log\n===================\n" |
|||
}|tee "${scriptlogdir}/${servicename}-email.log" > /dev/null 2>&1 |
|||
tail -25 "${scriptlog}" >> "${emaillog}" |
|||
if [ ! -z "${consolelog}" ]; then |
|||
echo -e "\n\nConsole log\n====================\n" >> "${emaillog}" |
|||
tail -25 "${consolelog}" >> "${emaillog}" |
|||
fi |
|||
if [ ! -z "${gamelogdir}" ]; then |
|||
echo -e "\n\nServer log\n====================\n" >> "${emaillog}" |
|||
tail "${gamelogdir}"/*|grep -v "==>"|sed '/^$/d'|tail -25 >> "${emaillog}" |
|||
fi |
|||
mail -s "${subject}" ${email} < "${emaillog}" |
|||
fn_printok "Sending notification to ${email}" |
|||
fn_scriptlog "Sent notification to ${email}" |
|||
sleep 1 |
|||
echo -en "\n" |
@ -1,21 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_emailtest function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: Sends a test email notification. |
|||
|
|||
local modulename="Email" |
|||
fn_rootcheck |
|||
fn_syscheck |
|||
if [ "${emailnotification}" = "on" ]; then |
|||
fn_scriptlog "Sending test notification" |
|||
subject="${servicename} Email Test Notification - Testing ${servername}" |
|||
failurereason="Testing ${servicename} email notification" |
|||
actiontaken="Sent test email...hello is this thing on?" |
|||
fn_emailnotification |
|||
else |
|||
fn_printfailnl "Notifications not enabled" |
|||
fn_scriptlog "Notifications not enabled" |
|||
fi |
@ -1,28 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_getquery function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 241214 |
|||
|
|||
fn_dlgsquery(){ |
|||
cd "${rootdir}" |
|||
echo -e "downloading gsquery.py...\c" |
|||
wget -N --no-check-certificate /dev/null "http://danielgibbs.co.uk/dl/gsquery.py" 2>&1 | grep -F "HTTP" | grep -v "Moved Permanently" | cut -c45- | uniq |
|||
chmod +x gsquery.py |
|||
} |
|||
|
|||
echo "" |
|||
echo "GameServerQuery" |
|||
echo "============================" |
|||
if [ -z ${autoinstall} ]; then |
|||
while true; do |
|||
read -p "Do you want to install GameServerQuery? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) fn_dlgsquery;break;; |
|||
[Nn]* ) echo ""; echo "Not installing GameServerQuery.";break;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
else |
|||
fn_dlgsquery |
|||
fi |
@ -1,116 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_glibcfix function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 1501214 |
|||
|
|||
fn_glibcfixmsg(){ |
|||
echo "" |
|||
echo "GLIBC Fix required" |
|||
echo "============================" |
|||
sleep 1 |
|||
fn_printwarningnl "${gamename} requires GLIBC_${glibcversion} or above" |
|||
sleep 1 |
|||
echo "" |
|||
echo -e "Currently installed:\e[0;31m GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')\e[0;39m" |
|||
echo -e "Required: =>\e[0;32m GLIBC_${glibcversion}\e[0;39m" |
|||
echo "" |
|||
sleep 1 |
|||
echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with less than GLIBC_${glibcversion}." |
|||
echo "note: This will NOT upgrade GLIBC on your system." |
|||
sleep 1 |
|||
echo "" |
|||
echo -en "loading required files.\r" |
|||
sleep 1 |
|||
echo -en "loading required files..\r" |
|||
sleep 1 |
|||
echo -en "loading required files...\r" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
} |
|||
|
|||
# if ldd command not detected |
|||
if [ -z $(command -v ldd) ]; then |
|||
echo "" |
|||
fn_printfailurenl "GLIBC is not detected" |
|||
sleep 1 |
|||
echo "Install GLIBC and retry installation." |
|||
sleep 1 |
|||
echo "" |
|||
while true; do |
|||
read -p "Continue install? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) echo Exiting; exit;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
# if Glibc less than 1.15 |
|||
elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 215 ]; then |
|||
# Blade Symphony |
|||
if [ "${gamename}" == "Blade Symphony" ]; then |
|||
glibcversion="2.15" |
|||
fn_glibcfixmsg |
|||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|||
# Fistful of Frags |
|||
elif [ "${gamename}" == "Fistful of Frags" ]; then |
|||
glibcversion="2.15" |
|||
fn_glibcfixmsg |
|||
cd "${filesdir}" |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/FistfulOfFrags/dependencies/libm.so.6 |
|||
# Garrys's Mod |
|||
elif [ "${gamename}" == "Garrys's Mod" ]; then |
|||
glibcversion="2.15" |
|||
fn_glibcfixmsg |
|||
cd "${filesdir}/bin" |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libc.so.6 |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libm.so.6 |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/GarrysMod/dependencies/libpthread.so.0 |
|||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|||
# Insurgency |
|||
elif [ "${gamename}" == "Insurgency" ]; then |
|||
glibcversion="2.15" |
|||
fn_glibcfixmsg |
|||
cd "${filesdir}/bin" |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libc.so.6 |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/librt.so.1 |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/Insurgency/dependencies/libpthread.so.0 |
|||
# Natural Selection 2 |
|||
elif [ "${gamename}" == "Natural Selection 2" ]; then |
|||
glibcversion="2.15" |
|||
fn_glibcfixmsg |
|||
cd "${filesdir}" |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/NaturalSelection2/dependencies/libm.so.6 |
|||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|||
# No More Room in Hell |
|||
elif [ "${gamename}" == "No More Room in Hell" ]; then |
|||
glibcversion="2.15" |
|||
fn_glibcfixmsg |
|||
cd "${filesdir}" |
|||
wget -nv -N --no-check-certificate https://github.com/dgibbs64/linuxgameservers/raw/master/NoMoreRoomInHell/dependencies/libm.so.6 |
|||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|||
# if Glibc less than 1.13 |
|||
elif [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt 213 ]; then |
|||
# ARMA 3 |
|||
if [ "${gamename}" == "ARMA 3" ]; then |
|||
glibcversion="2.13" |
|||
fn_glibcfixmsg |
|||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|||
# Just Cause 2 |
|||
elif [ "${gamename}" == "Just Cause 2" ]; then |
|||
glibcversion="2.13" |
|||
fn_glibcfixmsg |
|||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|||
# Serious Sam 3: BFE |
|||
elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then |
|||
glibcversion="2.13" |
|||
fn_glibcfixmsg |
|||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/Bin/libstdc++.so.6" |
|||
else |
|||
fn_printfailurenl "Unable to detect game. Fix not applied" |
|||
fi |
|||
else |
|||
fn_printfailurenl "Unable to detect game. Fix not applied" |
|||
fi |
|||
fi |
|||
sleep 1 |
@ -1,18 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_header function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 241214 |
|||
|
|||
clear |
|||
echo "=================================" |
|||
echo "${gamename}" |
|||
echo "Linux Game Server Manager" |
|||
echo "by Daniel Gibbs" |
|||
if [ "${gamename}" == "ARMA 3" ]; then |
|||
echo "contributions by Scarsz" |
|||
elif [ "${gamename}" == "Left 4 Dead" ]; then |
|||
echo "contributions by Summit Singh Thakur" |
|||
fi |
|||
echo "http://danielgibbs.co.uk" |
|||
echo "=================================" |
@ -1,12 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_installcomplete function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 241214 |
|||
|
|||
echo "=================================" |
|||
echo "Install Complete!" |
|||
echo "" |
|||
echo "To start server type:" |
|||
echo "${selfname} start" |
|||
echo "" |
@ -1,27 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_kffix function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Applying ${gamename} Server Fixes" |
|||
echo "=================================" |
|||
echo "Applying WebAdmin ROOst.css fix." |
|||
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/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" |
|||
sleep 1 |
|||
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 "applying server name fix." |
|||
sleep 1 |
|||
echo "forcing server restart..." |
|||
sleep 1 |
|||
cd "${rootdir}" |
|||
${selfname} start |
|||
sleep 5 |
|||
${selfname} restart |
|||
sleep 5 |
|||
${selfname} stop |
@ -1,8 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_load function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 141214 |
|||
# Depricated: fn_distrodetails has replaced this function. |
|||
|
|||
load=$(uptime|awk -F 'load average' '{ print $2 }') |
@ -1,42 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_loginstall function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 040115 |
|||
|
|||
echo "" |
|||
echo "Creating log directorys" |
|||
echo "=================================" |
|||
sleep 1 |
|||
# Create dir's for the script and console logs |
|||
mkdir -v "${rootdir}/log" |
|||
mkdir -v "${scriptlogdir}" |
|||
touch "${scriptlog}" |
|||
mkdir -v "${consolelogdir}" |
|||
touch "${consolelog}" |
|||
# If a server is source or goldsource create a symbolic link to the game server logs |
|||
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|||
if [ ! -h "${rootdir}/log/server" ]; then |
|||
ln -nfsv "${gamelogdir}" "${rootdir}/log/server" |
|||
else |
|||
echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!" |
|||
fi |
|||
fi |
|||
# If a server is unreal2 or unity3d create a dir |
|||
if [ "${engine}" == "unreal2" ]||[ "${engine}" == "unity3d" ]; then |
|||
mkdir -pv "${gamelogdir}" |
|||
fi |
|||
if [ "${gamename}" == "7 Days To Die" ]; then |
|||
if [ ! -h "${gamelogdir}/output_log.txt" ]; then |
|||
ln -nfsv "${filesdir}/7DaysToDie_Data/output_log.txt" "${gamelogdir}/output_log.txt" |
|||
fi |
|||
fi |
|||
# If server uses SteamCMD create a symbolic link to the Steam logs |
|||
if [ -d "${rootdir}/Steam/logs" ]; then |
|||
if [ ! -h "${rootdir}/log/steamcmd" ]; then |
|||
ln -nfsv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd" |
|||
else |
|||
echo "Symbolic link ${rootdir}/Steam/logs => ${rootdir}/log/steamcmd already exists!" |
|||
fi |
|||
fi |
|||
sleep 1 |
@ -1,50 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_logmanager function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: Acts as a log rotater, removing old logs. |
|||
|
|||
local modulename="Log Manager" |
|||
if [ ! -e "${consolelog}" ]; then |
|||
touch "${consolelog}" |
|||
fi |
|||
# log manager will active if finds logs older than ${logdays} |
|||
if [ $(find "${scriptlogdir}"/* -mtime +${logdays}|wc -l) -ne "0" ]; then |
|||
fn_printdots "Starting" |
|||
sleep 1 |
|||
fn_printok "Starting" |
|||
fn_scriptlog "Starting" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
fn_printinfo "Removing logs older than ${logdays} days" |
|||
fn_scriptlog "Removing logs older than ${logdays} days" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
if [ "${engine}" == "unreal2" ]; then |
|||
find "${gamelogdir}"/* -mtime +${logdays}|tee >> "${scriptlog}" |
|||
fi |
|||
find "${scriptlogdir}"/* -mtime +${logdays}|tee >> "${scriptlog}" |
|||
find "${consolelogdir}"/* -mtime +${logdays}|tee >> "${scriptlog}" |
|||
if [ "${engine}" == "unreal2" ]; then |
|||
gamecount=$(find "${scriptlogdir}"/* -mtime +${logdays}|wc -l) |
|||
fi |
|||
scriptcount=$(find "${scriptlogdir}"/* -mtime +${logdays}|wc -l) |
|||
consolecount=$(find "${consolelogdir}"/* -mtime +${logdays}|wc -l) |
|||
count=$((${scriptcount} + ${consolecount})) |
|||
if [ "${engine}" == "unreal2" ]; then |
|||
count=$((${scriptcount} + ${consolecount} + ${gamecount})) |
|||
else |
|||
count=$((${scriptcount} + ${consolecount})) |
|||
fi |
|||
if [ "${engine}" == "unreal2" ]; then |
|||
find "${gamelogdir}"/* -mtime +${logdays} -exec rm {} \; |
|||
fi |
|||
find "${scriptlogdir}"/* -mtime +${logdays} -exec rm {} \; |
|||
find "${consolelogdir}"/* -mtime +${logdays} -exec rm {} \; |
|||
fn_printok "Removed ${count} log files" |
|||
fn_scriptlog "Removed ${count} log files" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
fi |
@ -1,59 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_monitorserver function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: Monitors server by checking for running proccesses |
|||
# then passes to fn_serverquery. |
|||
|
|||
local modulename="Monitor" |
|||
fn_rootcheck |
|||
fn_syscheck |
|||
fn_autoip |
|||
fn_printdots "${servername}" |
|||
fn_scriptlog "${servername}" |
|||
sleep 1 |
|||
if [ ! -f "${lockselfname}" ]; then |
|||
fn_printinfo "Disabled: No lock file found" |
|||
fn_scriptlog "Disabled: No lock file found" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
echo "To enable monitor run ${selfname} start" |
|||
exit |
|||
fi |
|||
updatecheck=$(ps -ef|grep "${selfname} update"|grep -v grep|wc -l) |
|||
if [ "${updatecheck}" = "0" ]; then |
|||
fn_printdots "Checking session: CHECKING" |
|||
fn_scriptlog "Checking session: CHECKING" |
|||
sleep 1 |
|||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -E "^${servicename}:"|wc -l) |
|||
if [ "${tmuxwc}" -eq 1 ]; then |
|||
fn_printok "Checking session: OK" |
|||
fn_scriptlog "Checking session: OK" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
fn_serverquery |
|||
exit |
|||
else |
|||
fn_printfail "Checking session: FAIL" |
|||
fn_scriptlog "Checking session: FAIL" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
if [ "${emailnotification}" = "on" ]; then |
|||
subject="${servicename} Monitor - Starting ${servername}" |
|||
failurereason="${servicename} process not running" |
|||
actiontaken="${servicename} has been restarted" |
|||
fn_emailnotification |
|||
fi |
|||
fn_scriptlog "Monitor is starting ${servername}" |
|||
fn_startserver |
|||
fi |
|||
else |
|||
fn_printinfonl "SteamCMD is currently checking for updates" |
|||
fn_scriptlog "SteamCMD is currently checking for updates" |
|||
sleep 1 |
|||
fn_printinfonl "When update is complete ${servicename} will start" |
|||
fn_scriptlog "When update is complete ${servicename} will start" |
|||
sleep 1 |
|||
fi |
@ -1,14 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_retryinstall function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
while true; do |
|||
read -p "Retry install? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) fn_install; exit;; |
|||
[Nn]* ) echo Exiting; exit;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
@ -1,27 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_rofix function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Applying ${gamename} Server Fixes" |
|||
echo "=================================" |
|||
echo "Applying WebAdmin ROOst.css fix!" |
|||
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/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" |
|||
sleep 1 |
|||
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 "applying server name fix." |
|||
sleep 1 |
|||
echo "forcing server restart..." |
|||
sleep 1 |
|||
cd "${rootdir}" |
|||
${selfname} start |
|||
sleep 5 |
|||
${selfname} restart |
|||
sleep 5 |
|||
${selfname} stop |
@ -1,10 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_rootcheck function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 241214 |
|||
|
|||
if [ $(whoami) = "root" ]; then |
|||
fn_printfailnl "Do NOT run this script as root!" |
|||
exit |
|||
fi |
@ -1,242 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_serverconfig function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 241214 |
|||
|
|||
fn_arma3config(){ |
|||
cp -v lgsm-default.cfg "${servercfgfullpath}" |
|||
sleep 1 |
|||
echo "" |
|||
} |
|||
|
|||
fn_goldsourceconfig(){ |
|||
echo "creating ${servicename}.cfg config file." |
|||
cp -v lgsm-default.cfg "${servercfgfullpath}" |
|||
sleep 1 |
|||
echo "creating server.cfg." |
|||
touch "${defaultcfg}" |
|||
sleep 1 |
|||
echo "creating redirect." |
|||
echo "server.cfg > ${servercfg}." |
|||
echo "exec ${servercfg}" > "${defaultcfg}" |
|||
echo "creating listip.cfg." |
|||
sleep 1 |
|||
touch "${systemdir}/listip.cfg" |
|||
echo "creating banned.cfg." |
|||
touch "${systemdir}/banned.cfg" |
|||
sleep 1 |
|||
if [ -z "${autoinstall}" ]; then |
|||
echo "" |
|||
echo "Configuring ${gamename} Server" |
|||
echo "=================================" |
|||
sleep 1 |
|||
read -p "Enter server name: " servername |
|||
read -p "Enter rcon password: " rconpass |
|||
else |
|||
servername="${servicename}" |
|||
rconpass="rconpassword" |
|||
fi |
|||
sed -i "s/\"hostname\"/\"${servername}\"/g" "${servercfgfullpath}" |
|||
sed -i "s/\"rconpassword\"/\"${rconpass}\"/g" "${servercfgfullpath}" |
|||
echo "" |
|||
} |
|||
|
|||
fn_jc2config(){ |
|||
cd "${filesdir}" |
|||
cp -v default_config.lua config.lua |
|||
sleep 1 |
|||
echo "" |
|||
} |
|||
|
|||
fn_serious3config(){ |
|||
cp -v lgsm-default.ini ${servercfg} |
|||
sleep 1 |
|||
echo "" |
|||
} |
|||
|
|||
fn_sourceconfig(){ |
|||
echo "creating ${servicename}.cfg config file." |
|||
cp -v lgsm-default.cfg "${servercfgfullpath}" |
|||
sleep 1 |
|||
echo "creating server.cfg." |
|||
touch "${defaultcfg}" |
|||
sleep 1 |
|||
echo "creating redirect." |
|||
echo "server.cfg > ${servercfg}." |
|||
echo "exec ${servercfg}" > "${defaultcfg}" |
|||
sleep 1 |
|||
if [ -z "${autoinstall}" ]; then |
|||
echo "" |
|||
echo "Configuring ${gamename} Server" |
|||
echo "=================================" |
|||
sleep 1 |
|||
read -p "Enter server name: " servername |
|||
read -p "Enter rcon password: " rconpass |
|||
else |
|||
servername="${servicename}" |
|||
rconpass="rconpassword" |
|||
fi |
|||
sed -i "s/\"hostname\"/\"${servername}\"/g" "${servercfgfullpath}" |
|||
sed -i "s/\"rconpassword\"/\"${rconpass}\"/g" "${servercfgfullpath}" |
|||
echo "" |
|||
} |
|||
|
|||
fn_ut99config(){ |
|||
echo "${defaultcfg} > ${systemdir}/${ini}" |
|||
tr -d '\r' < "${defaultcfg}" > "${systemdir}/${ini}" |
|||
sleep 1 |
|||
echo "" |
|||
echo "Configuring ${gamename} Server" |
|||
echo "=================================" |
|||
sleep 1 |
|||
echo "enabling WebAdmin." |
|||
sed -i 's/bEnabled=False/bEnabled=True/g' "${systemdir}/${ini}" |
|||
sleep 1 |
|||
echo "setting WebAdmin port to 8076." |
|||
sed -i '467i\ListenPort=8076' "${systemdir}/${ini}" |
|||
sleep 1 |
|||
echo "" |
|||
} |
|||
|
|||
fn_unity3dconfig(){ |
|||
cp -v serverconfig.xml ${servercfg} |
|||
sleep 1 |
|||
echo "" |
|||
} |
|||
|
|||
fn_unreal2config(){ |
|||
cp -v "${defaultcfg}" "${systemdir}/${ini}" |
|||
sleep 1 |
|||
echo "" |
|||
echo "Configuring ${gamename} Server" |
|||
echo "=================================" |
|||
sleep 1 |
|||
echo "setting WebAdmin username and password." |
|||
sed -i 's/AdminName=/AdminName=admin/g' "${systemdir}/${ini}" |
|||
sed -i 's/AdminPassword=/AdminPassword=admin/g' "${systemdir}/${ini}" |
|||
sleep 1 |
|||
echo "enabling WebAdmin." |
|||
sed -i 's/bEnabled=False/bEnabled=True/g' "${systemdir}/${ini}" |
|||
if [ "${gamename}" == "Unreal Tournament 2004" ]; then |
|||
sleep 1 |
|||
echo "setting WebAdmin port to 8075." |
|||
sed -i 's/ListenPort=80/ListenPort=8075/g' "${systemdir}/${ini}" |
|||
fi |
|||
sleep 1 |
|||
echo "" |
|||
} |
|||
|
|||
echo "" |
|||
echo "Creating Configs" |
|||
echo "=================================" |
|||
sleep 1 |
|||
cd "${servercfgdir}" |
|||
if [ "${gamename}" == "7 Days To Die" ]; then |
|||
fn_unity3dconfig |
|||
elif [ "${gamename}" == "ARMA 3" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Arma3/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_arma3config |
|||
elif [ "${gamename}" == "Blade Symphony" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/BladeSymphony/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_goldsourceconfig |
|||
elif [ "${gamename}" == "Counter Strike 1.6" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrike/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_goldsourceconfig |
|||
elif [ "${gamename}" == "Counter Strike: Condition Zero" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeConditionZero/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_goldsourceconfig |
|||
elif [ "${gamename}" == "Counter Strike: Global Offensive" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Counter Strike: Source" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeSource/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Day of Defeat" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/DayOfDefeat/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_goldsourceconfig |
|||
elif [ "${gamename}" == "Day of Defeat: Source" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/DayOfDefeatSource/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Fistful of Frags" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/FistfulOfFrags/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Garrys's Mod" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/GarrysMod/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Half Life 2: Deathmatch" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/HalfLife2Deathmatch/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Half Life: Deathmatch Classic" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/HalfLifeDeathmatchClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_goldsourceconfig |
|||
elif [ "${gamename}" == "Insurgency" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Insurgency/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Just Cause 2" ]; then |
|||
fn_jc2config |
|||
elif [ "${gamename}" == "Killing Floor" ]; then |
|||
fn_unreal2config |
|||
elif [ "${gamename}" == "Left 4 Dead" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Left4Dead/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Left 4 Dead 2" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Left4Dead2/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "No More Room in Hell" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/NoMoreRoomInHell/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then |
|||
fn_unreal2config |
|||
elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then |
|||
echo -e "downloading lgsm-default.ini...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/SeriousSam3BFE/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_serious3config |
|||
elif [ "${gamename}" == "Team Fortress 2" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/TeamFortress2/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_sourceconfig |
|||
elif [ "${gamename}" == "Team Fortress Classic" ]; then |
|||
echo -e "downloading lgsm-default.cfg...\c" |
|||
wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/TeamFortressClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq |
|||
sleep 1 |
|||
fn_goldsourceconfig |
|||
elif [ "${gamename}" == "Unreal Tournament 2004" ]; then |
|||
fn_unreal2config |
|||
elif [ "${gamename}" == "Unreal Tournament 99" ]; then |
|||
fn_ut99config |
|||
fi |
@ -1,23 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_serverdirectory function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
echo "" |
|||
echo "Server Directory" |
|||
echo "=================================" |
|||
echo "" |
|||
pwd |
|||
echo "" |
|||
if [ -d "${filesdir}" ]; then |
|||
fn_printwarningnl "A server is already installed here." |
|||
fi |
|||
while true; do |
|||
read -p "Continue [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) echo Exiting; return 1;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
@ -1,23 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_servername function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 150115 |
|||
|
|||
# Description: Gets the server name. |
|||
|
|||
if [ "${engine}" == "avalanche" ]; then |
|||
servername=$(grep -s Name "${servercfgfullpath}"|sed 's/Name//g' | tr -d '=\"; '|sed 's/,//g') |
|||
elif [ "${engine}" == "realvirtuality" ]; then |
|||
servername=$(grep -s hostname "${servercfgfullpath}"| grep -v //|sed -e 's/\<hostname\>//g'| tr -d '=\"; ') |
|||
elif [ "${engine}" == "seriousengine35" ]; then |
|||
servername=$(grep -s prj_strMultiplayerSessionName "${servercfgfullpath}"|sed 's/prj_strMultiplayerSessionName = //g'|sed 's/"//g'|sed 's/;//g') |
|||
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|||
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') |
|||
elif [ "${engine}" == "spark" ]; then |
|||
: # Not in config file |
|||
elif [ "${engine}" == "unity3d" ]; then |
|||
servername=$(grep ServerName "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"") |
|||
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then |
|||
servername=$(grep -s ServerName= ${systemdir}/${ini}|sed 's/ServerName=//g') |
|||
fi |
@ -1,84 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_serverquery function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: uses gsquery.py to directly query the server. |
|||
# Detects if the server has frozen. |
|||
|
|||
local modulename="Monitor" |
|||
if [ -f gsquery.py ]; then |
|||
if [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then |
|||
gameport=$(grep Port= "${systemdir}/${ini}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|tr -d '\r'|tr -cd [:digit:]) |
|||
port=$((${gameport} + 1)) |
|||
elif [ "${engine}" == "spark" ]; then |
|||
port=$((${port} + 1)) |
|||
elif [ "${engine}" == "realvirtuality" ]; then |
|||
queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:]) |
|||
port=${queryport} |
|||
elif [ "${engine}" == "unity3d" ]; then |
|||
gameport=$(grep ServerPort "${servercfgfullpath}"|tr -cd [:digit:]) |
|||
port=$((${gameport} + 1)) |
|||
fi |
|||
fn_printinfo "Detected gsquery.py" |
|||
fn_scriptlog "Detected gsquery.py" |
|||
sleep 1 |
|||
fn_printdots "Querying port: ${ip}:${port} : QUERYING" |
|||
fn_scriptlog "Querying port: ${ip}:${port} : QUERYING" |
|||
sleep 1 |
|||
serverquery=$(./gsquery.py -a ${ip} -p ${port} -e ${engine} 2>&1) |
|||
exitcode=$? |
|||
if [ "${exitcode}" == "1" ]||[ "${exitcode}" == "2" ]||[ "${exitcode}" == "3" ]||[ "${exitcode}" == "4" ]; then |
|||
fn_printfail "Querying port: ${ip}:${port} : ${serverquery}" |
|||
fn_scriptlog "Querying port: ${ip}:${port} : ${serverquery}" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
if [[ -z "${secondquery}" ]]; then |
|||
fn_printinfo "Waiting 30 seconds to re-query" |
|||
fn_scriptlog "Waiting 30 seconds to re-query" |
|||
sleep 30 |
|||
secondquery=1 |
|||
fn_serverquery |
|||
fi |
|||
if [ "${emailnotification}" = "on" ]; then |
|||
subject="${servicename} Monitor - Starting ${servername}" |
|||
failurereason="Failed to query ${servicename}: ${serverquery}" |
|||
actiontaken="restarted ${servicename}" |
|||
fn_emailnotification |
|||
fi |
|||
fn_restartserver |
|||
exit |
|||
elif [ "${exitcode}" == "0" ]; then |
|||
fn_printok "Querying port: ${ip}:${port} : OK" |
|||
fn_scriptlog "Querying port: ${ip}:${port} : OK" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
exit |
|||
elif [ "${exitcode}" == "126" ]; then |
|||
fn_printfail "Querying port: ${ip}:${port} : ERROR: ./gsquery.py: Permission denied" |
|||
fn_scriptlog "Querying port: ${ip}:${port} : ERROR: ./gsquery.py: Permission denied" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
echo "Attempting to resolve automatically" |
|||
chmod +x -v gsquery.py |
|||
exitcode=$? |
|||
if [ "${exitcode}" == "0" ]; then |
|||
fn_serverquery |
|||
else |
|||
fn_printfailure "Unable to resolve automatically. Please manually fix permissions.\n" |
|||
owner=$(ls -al gsquery.py|awk '{ print $3 }') |
|||
echo "As user ${owner} or root run the following command." |
|||
whoami=$(whoami) |
|||
echo -en "\nchown ${whoami}:${whoami} gsquery.py\n\n" |
|||
exit |
|||
fi |
|||
else |
|||
fn_printfail "Querying port: ${ip}:${port} : UNKNOWN ERROR" |
|||
fn_scriptlog "Querying port: ${ip}:${port} : UNKNOWN ERROR" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
./gsquery.py -a ${ip} -p ${port} -e ${engine} |
|||
exit |
|||
fi |
|||
fi |
@ -1,68 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_startserver function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 090115 |
|||
|
|||
# Description: Starts the server. |
|||
|
|||
local modulename="Starting" |
|||
fn_rootcheck |
|||
fn_syscheck |
|||
fn_autoip |
|||
if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then |
|||
startfix=1 |
|||
fn_csgofix |
|||
fi |
|||
fn_parms |
|||
fn_logmanager |
|||
fn_printdots "${servername}" |
|||
fn_scriptlog "${servername}" |
|||
sleep 1 |
|||
fn_tmuxcheck |
|||
fn_steamdl |
|||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") |
|||
if [ "${tmuxwc}" -eq 0 ]; then |
|||
fn_scriptlog "Rotating log files" |
|||
if [ "${engine}" == "unreal2" ]; then |
|||
mv "${gamelog}" "${gamelogdate}" |
|||
fi |
|||
mv "${scriptlog}" "${scriptlogdate}" |
|||
mv "${consolelog}" "${consolelogdate}" |
|||
fi |
|||
|
|||
if [ "${tmuxwc}" -eq 1 ]; then |
|||
fn_printinfo "${servername} is already running" |
|||
fn_scriptlog "${servername} is already running" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
exit |
|||
fi |
|||
# Create lock file |
|||
date > "${rootdir}/${lockselfname}" |
|||
cd "${executabledir}" |
|||
tmux new-session -d -s ${servicename} "${executable} ${parms}" 2> "${scriptlogdir}/.${servicename}-tmux-error.tmp" |
|||
# tmux pipe-pane not supported in tmux versions < 1.6 |
|||
if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd [:digit:]|tail -c 3)" -lt "16" ]; then |
|||
echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}" |
|||
echo "Currently installed: $(tmux -V)" >> "${consolelog}" |
|||
else |
|||
tmux pipe-pane -o -t ${servicename} "exec cat >> '${consolelog}'" |
|||
fi |
|||
sleep 1 |
|||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") |
|||
if [ "${tmuxwc}" -eq 0 ]; then |
|||
fn_printfailnl "Unable to start ${servername}" |
|||
fn_scriptlog "Unable to start ${servername}" |
|||
echo -en " Check log files: ${rootdir}/log" |
|||
if [ -a "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then |
|||
fn_scriptlog "tmux returned the following error" |
|||
cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" >> "${scriptlog}" |
|||
fi |
|||
else |
|||
fn_printok "${servername}" |
|||
fn_scriptlog "Started ${servername}" |
|||
fi |
|||
rm "${scriptlogdir}/.${servicename}-tmux-error.tmp" |
|||
sleep 1 |
|||
echo -en "\n" |
@ -1,51 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_steamdl function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 090115 |
|||
|
|||
# Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD |
|||
|
|||
|
|||
if [ "${gamename}" == "Unreal Tournament 99" ]||[ "${modulename}" == "Unreal Tournament 2004" ]; then |
|||
: # These servers do not require SteamCMD. Check is skipped. |
|||
elif [ "${modulename}" == "Starting" ]||[ "${modulename}" == "Update" ]; then |
|||
# Checks if SteamCMD exists when starting or updating a server. |
|||
# Re-installs if missing. |
|||
if [ ! -f ${rootdir}/steamcmd/steamcmd.sh ]; then |
|||
fn_printwarn "SteamCMD is missing" |
|||
fn_scriptlog "SteamCMD is missing" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
mkdir -pv "${rootdir}/steamcmd" |
|||
cd "${rootdir}/steamcmd" |
|||
echo -e "downloading steamcmd_linux.tar.gz...\c" |
|||
wget -N --no-check-certificate /dev/null http://media.steampowered.com/client/steamcmd_linux.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq |
|||
tar --verbose -zxf steamcmd_linux.tar.gz |
|||
rm -v steamcmd_linux.tar.gz |
|||
chmod +x steamcmd.sh |
|||
fn_scriptlog "Re-installed SteamCMD" |
|||
fn_printdots "${servername}" |
|||
sleep 1 |
|||
fi |
|||
cd "${rootdir}" |
|||
else |
|||
echo "" |
|||
echo "Installing SteamCMD" |
|||
echo "=================================" |
|||
cd "${rootdir}" |
|||
mkdir -pv "steamcmd" |
|||
sleep 1 |
|||
cd "steamcmd" |
|||
if [ ! -f steamcmd.sh ]; then |
|||
echo -e "downloading steamcmd_linux.tar.gz...\c" |
|||
wget -N --no-check-certificate /dev/null http://media.steampowered.com/client/steamcmd_linux.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq |
|||
tar --verbose -zxf steamcmd_linux.tar.gz |
|||
rm -v steamcmd_linux.tar.gz |
|||
chmod +x steamcmd.sh |
|||
sleep 1 |
|||
else |
|||
echo "Steam already installed!" |
|||
fi |
|||
sleep 1 |
|||
fi |
@ -1,40 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_libsteamfix function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
fn_steamclientfix(){ |
|||
echo "" |
|||
echo "Applying steamclient.so fix" |
|||
echo "=================================" |
|||
sleep 1 |
|||
mkdir -pv "${HOME}/.steam" |
|||
mkdir -pv "${HOME}/.steam/sdk32" |
|||
cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" |
|||
sleep 1 |
|||
echo "" |
|||
} |
|||
|
|||
# Gary's Mod Specific |
|||
fn_libsteamfix(){ |
|||
echo "" |
|||
echo "Applying libsteam.so fix" |
|||
echo "=================================" |
|||
sleep 1 |
|||
mkdir -pv "${HOME}/.steam" |
|||
mkdir -pv "${HOME}/.steam/sdk32" |
|||
if [ "${gamename}" == "Garrys's Mod" ]; then |
|||
cp -v "${filesdir}/bin/libsteam.so" "${HOME}/.steam/sdk32/libsteam.so" |
|||
elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then |
|||
mkdir "${HOME}/.steam/bin32" |
|||
cp -v "${filesdir}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" |
|||
fi |
|||
sleep 1 |
|||
echo "" |
|||
} |
|||
|
|||
fn_steamclientfix |
|||
if [ "${gamename}" == "Garrys's Mod" ]||[ "${gamename}" == "Serious Sam 3: BFE" ]; then |
|||
fn_libsteamfix |
|||
fi |
@ -1,72 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_steaminstall function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 110115 |
|||
|
|||
fn_steaminstallcommand(){ |
|||
counter="0" |
|||
while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .fn_steaminstall.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .fn_steaminstall.tmp)" -ge "1" ]; do |
|||
counter=$((counter+1)) |
|||
if [ "${counter}" -le "10" ]; then |
|||
# Attempt 1-4: Standard attempt |
|||
# Attempt 5-6: Validate attempt |
|||
# Attempt 7-8: Validate, delete long name dir |
|||
# Attempt 9-10: Validate, delete long name dir, re-download SteamCMD |
|||
# Attempt 11: Failure |
|||
|
|||
if [ "${counter}" -ge "2" ]; then |
|||
fn_printwarningnl "SteamCMD did not complete the download, retrying: Attempt ${counter}:" |
|||
fi |
|||
|
|||
if [ "${counter}" -ge "7" ]; then |
|||
echo "Removing $(find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$')" |
|||
find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf |
|||
fi |
|||
if [ "${counter}" -ge "9" ]; then |
|||
rm -rf "${rootdir}/steamcmd" |
|||
fn_steamdl |
|||
fi |
|||
if [ "${counter}" -le "4" ]; then |
|||
./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_steaminstall.tmp |
|||
elif [ "${counter}" -ge "5" ]; then |
|||
./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_steaminstall.tmp |
|||
fi |
|||
elif [ "${counter}" -ge "11" ]; then |
|||
fn_printfailurenl "SteamCMD did not complete the download, too many retrys" |
|||
break |
|||
fi |
|||
|
|||
done |
|||
|
|||
# Goldsource servers commonly fail to download all the server files required. |
|||
# Validating a few of times may reduce the chance of this issue. |
|||
if [ "${engine}" == "goldsource" ]; then |
|||
counter="0" |
|||
while [ "${counter}" <= "4" ]; do |
|||
counter=$((counter+1)) |
|||
./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_steaminstall.tmp |
|||
done |
|||
fi |
|||
rm -f .fn_steaminstall.tmp |
|||
} |
|||
|
|||
echo "" |
|||
echo "Installing ${gamename} Server" |
|||
echo "=================================" |
|||
sleep 1 |
|||
mkdir -pv "${filesdir}" |
|||
cd "${rootdir}/steamcmd" |
|||
fn_steaminstallcommand |
|||
if [ -z "${autoinstall}" ]; then |
|||
echo "" |
|||
echo "=================================" |
|||
while true; do |
|||
read -p "Was the install successful? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) fn_retryinstall;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
fi |
@ -1,28 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_stopserver function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: Stops the server. |
|||
|
|||
local modulename="Stopping" |
|||
fn_rootcheck |
|||
fn_syscheck |
|||
fn_printdots "${servername}" |
|||
fn_scriptlog "${servername}" |
|||
sleep 1 |
|||
fn_tmuxcheck |
|||
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") |
|||
if [ "${pid}" == "0" ]; then |
|||
fn_printfail "${servername} is already stopped" |
|||
fn_scriptlog "${servername} is already stopped" |
|||
else |
|||
tmux kill-session -t ${servicename} |
|||
fn_printok "${servername}" |
|||
fn_scriptlog "Stopped ${servername}" |
|||
fi |
|||
# Remove lock file |
|||
rm -f "${lockselfname}" |
|||
sleep 1 |
|||
echo -en "\n" |
@ -1,10 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_systemdircheck function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 241214 |
|||
|
|||
if [ ! -e "${systemdir}" ]; then |
|||
fn_printfailnl "Cannot access ${systemdir}: No such directory" |
|||
exit |
|||
fi |
@ -1,17 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_tmuxcheck function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
# Checks if tmux is installed as too many users do not RTFM or know how to use Google. |
|||
|
|||
if [ -z $(command -v tmux) ]; then |
|||
fn_printfailnl "Tmux not installed" |
|||
sleep 1 |
|||
fn_scriptlog "Tmux is not installed" |
|||
echo " * Tmux is required to run this server." |
|||
# Suitable passive agressive message |
|||
echo " * Please see 'Prerequisites' section of installation instructions." |
|||
exit |
|||
fi |
@ -1,33 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut2k4compressmaps function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
fn_rootcheck |
|||
clear |
|||
echo "${gamename} Map Compressor" |
|||
echo "============================" |
|||
echo "Will compress all maps in:" |
|||
echo "" |
|||
pwd |
|||
echo "" |
|||
echo "Compressed maps saved to:" |
|||
echo "" |
|||
echo "${compressedmapsdir}" |
|||
echo "" |
|||
while true; do |
|||
read -p "Start compression [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) echo Exiting; return 1;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 |
|||
rm -rfv "${filesdir}/Maps/*.uz2" |
|||
cd "${systemdir}" |
|||
for map in "${filesdir}/Maps/*"; do |
|||
./ucc-bin compress "../Maps/${map}" --nohomedir |
|||
done |
|||
mv -fv "${filesdir}/Maps/*.uz2" "${compressedmapsdir}" |
@ -1,20 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_updateserver function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 090115 |
|||
|
|||
# Description: Runs a server update. |
|||
|
|||
local modulename="Update" |
|||
fn_rootcheck |
|||
fn_syscheck |
|||
fn_printdots "Updating ${servername}" |
|||
sleep 1 |
|||
fn_steamdl |
|||
fn_printok "Updating ${servername}" |
|||
fn_scriptlog "Updating ${servername}" |
|||
sleep 1 |
|||
cd "${rootdir}" |
|||
cd "steamcmd" |
|||
./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit|tee -a "${scriptlog}" |
@ -1,12 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_uptime function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 141214 |
|||
# Depricated: fn_distrodetails has replaced this function. |
|||
|
|||
uptime=$(</proc/uptime) |
|||
uptime=${uptime%%.*} |
|||
minutes=$(( uptime/60%60 )) |
|||
hours=$(( uptime/60/60%24 )) |
|||
days=$(( uptime/60/60/24 )) |
@ -1,54 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut2k4filesdl function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Downloading Server Files" |
|||
echo "=================================" |
|||
cd "${rootdir}" |
|||
mkdir -pv "${filesdir}" |
|||
cd "${filesdir}" |
|||
if [ ! -f dedicatedserver3339-bonuspack.zip ]; then |
|||
wget http://danielgibbs.co.uk/wp-content/uploads/ut2004/dedicatedserver3339-bonuspack.zip |
|||
else |
|||
echo "dedicatedserver3339-bonuspack.zip already downloaded!" |
|||
fi |
|||
echo "Running MD5 checksum to verify the file" |
|||
sleep 1 |
|||
echo "MD5 checksum: d3f28c5245c4c02802d48e4f0ffd3e34" |
|||
md5check=$(md5sum dedicatedserver3339-bonuspack.zip|awk '{print $1;}') |
|||
echo "File returned: ${md5check}" |
|||
if [ "${md5check}" != "d3f28c5245c4c02802d48e4f0ffd3e34" ]; then |
|||
echo "MD5 checksum: FAILED!" |
|||
read -p "Retry download? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; fn_ut2k4filesdl;; |
|||
[Nn]* ) echo Exiting; exit;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
else |
|||
echo "MD5 checksum: PASSED" |
|||
fi |
|||
if [ ! -f ut2004-lnxpatch3369-2.tar.bz2 ]; then |
|||
wget http://danielgibbs.co.uk/wp-content/uploads/ut2004/ut2004-lnxpatch3369-2.tar.bz2 |
|||
else |
|||
echo "ut2004-lnxpatch3369-2.tar.bz2 already downloaded!" |
|||
fi |
|||
echo "Running MD5 checksum to verify the file" |
|||
sleep 1 |
|||
echo "MD5 checksum: 0fa447e05fe5a38e0e32adf171be405e" |
|||
md5check=$(md5sum ut2004-lnxpatch3369-2.tar.bz2|awk '{print $1;}') |
|||
echo "File returned: ${md5check}" |
|||
if [ "${md5check}" != "0fa447e05fe5a38e0e32adf171be405e" ]; then |
|||
echo "MD5 checksum: FAILED!" |
|||
read -p "Retry download? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; fn_ut2k4filesdl;; |
|||
[Nn]* ) echo Exiting; exit;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
else |
|||
echo "MD5 checksum: PASSED" |
|||
fi |
|||
echo "" |
@ -1,27 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut2k4fix function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Applying ${gamename} Server Fixes" |
|||
echo "=================================" |
|||
echo "applying WebAdmin ut2003.css fix." |
|||
echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" |
|||
sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ut2003.css" |
|||
sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ut2003.css" |
|||
sleep 1 |
|||
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 "applying server name fix." |
|||
sleep 1 |
|||
echo "forcing server restart..." |
|||
sleep 1 |
|||
cd "${rootdir}" |
|||
${selfname} start |
|||
sleep 5 |
|||
${selfname} restart |
|||
sleep 5 |
|||
${selfname} stop |
@ -1,42 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut2k4install function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Installing ${gamename} Server" |
|||
echo "=================================" |
|||
sleep 1 |
|||
mkdir -pv "${filesdir}" |
|||
cd "${filesdir}" |
|||
echo "Extracting dedicatedserver3339-bonuspack.zip" |
|||
sleep 1 |
|||
unzip dedicatedserver3339-bonuspack.zip |
|||
echo "Extracting ut2004-lnxpatch3369-2.tar.bz2" |
|||
sleep 1 |
|||
tar -xvjf ut2004-lnxpatch3369-2.tar.bz2 UT2004-Patch/ --strip-components=1 |
|||
while true; do |
|||
read -p "Was the install successful? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) fn_retryinstall;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
while true; do |
|||
read -p "Remove ut2004-lnxpatch3369-2.tar.bz2? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; break;; |
|||
[Nn]* ) break;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
while true; do |
|||
read -p "Remove dedicatedserver3339-bonuspack.zip? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; break;; |
|||
[Nn]* ) break;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
echo "" |
@ -1,18 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut2k4key function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Enter ${gamename} CD Key" |
|||
echo "=================================" |
|||
sleep 1 |
|||
echo "To get your server listed on the Master Server list" |
|||
echo "you must get a free CD key. Get a key here:" |
|||
echo "http://www.unrealtournament.com/ut2004server/cdkey.php" |
|||
echo "" |
|||
echo "Once you have the key enter it below" |
|||
echo -n "KEY: " |
|||
read CODE |
|||
echo ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" |
|||
echo "" |
@ -1,33 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut2k4compressmaps function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
fn_rootcheck |
|||
clear |
|||
echo "${gamename} Map Compressor" |
|||
echo "============================" |
|||
echo "Will compress all maps in:" |
|||
echo "" |
|||
pwd |
|||
echo "" |
|||
echo "Compressed maps saved to:" |
|||
echo "" |
|||
echo "${compressedmapsdir}" |
|||
echo "" |
|||
while true; do |
|||
read -p "Start compression [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) echo Exiting; return 1;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 |
|||
rm -rfv "${filesdir}/Maps/*.unr.uz" |
|||
cd "${systemdir}" |
|||
for map in "${filesdir}/Maps/*"; do |
|||
./ucc-bin compress ../Maps/${map} --nohomedir |
|||
done |
|||
mv -fv "${filesdir}/Maps/*.unr.uz" "${compressedmapsdir}" |
@ -1,54 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut99filesdl function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Downloading Server Files" |
|||
echo "=================================" |
|||
cd "${rootdir}" |
|||
mkdir -pv "${filesdir}" |
|||
cd "${filesdir}" |
|||
if [ ! -f ut-server-436.tar.gz ]; then |
|||
wget http://danielgibbs.co.uk/wp-content/uploads/ut-server-436.tar.gz |
|||
else |
|||
echo "ut-server-436.tar.gz already downloaded!" |
|||
fi |
|||
echo "Running MD5 checksum to verify the file" |
|||
sleep 1 |
|||
echo "MD5 checksum: 10cd7353aa9d758a075c600a6dd193fd" |
|||
md5check=$(md5sum ut-server-436.tar.gz|awk '{print $1;}') |
|||
echo "File returned: ${md5check}" |
|||
if [ "${md5check}" != "10cd7353aa9d758a075c600a6dd193fd" ]; then |
|||
echo "MD5 checksum: FAILED!" |
|||
read -p "Retry download? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) rm -fv ut-server-436.tar.gz; fn_filesdl;; |
|||
[Nn]* ) echo Exiting; exit;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
else |
|||
echo "MD5 checksum: PASSED" |
|||
fi |
|||
if [ ! -f UTPGPatch451.tar.bz2 ]; then |
|||
wget http://danielgibbs.co.uk/wp-content/uploads/UTPGPatch451.tar.bz2 |
|||
else |
|||
echo "UTPGPatch451.tar.bz2 already downloaded!" |
|||
fi |
|||
echo "Running MD5 checksum to verify the file" |
|||
sleep 1 |
|||
echo "MD5 checksum: 77a735a78b1eb819042338859900b83b" |
|||
md5check=$(md5sum UTPGPatch451.tar.bz2|awk '{print $1;}') |
|||
echo "File returned: ${md5check}" |
|||
if [ "${md5check}" != "77a735a78b1eb819042338859900b83b" ]; then |
|||
echo "MD5 checksum: FAILED!" |
|||
read -p "Retry download? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) rm -fv UTPGPatch451.tar.bz2; fn_filesdl;; |
|||
[Nn]* ) echo Exiting; exit;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
else |
|||
echo "MD5 checksum: PASSED" |
|||
fi |
|||
echo "" |
@ -1,24 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut99fix function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Applying ${gamename} Server Fixes" |
|||
echo "=================================" |
|||
echo "enabling UdpServerUplink." |
|||
{ |
|||
echo "[IpServer.UdpServerUplink]" |
|||
echo "DoUplink=True" |
|||
echo "UpdateMinutes=1" |
|||
echo "MasterServerAddress=unreal.epicgames.com" |
|||
echo "MasterServerPort=27900" |
|||
echo "Region=0" |
|||
}|tee -a "${systemdir}/${ini}" > /dev/null 2>&1 |
|||
sleep 1 |
|||
echo "removing dead mplayer.com master server." |
|||
sed -i '/master.mplayer.com/d' "${systemdir}/${ini}" |
|||
sleep 1 |
|||
echo "inserting qtracker.com master server." |
|||
sed -i '66i\ServerActors=IpServer.UdpServerUplink MasterServerAddress=master.qtracker.com MasterServerPort=27900' "${systemdir}/${ini}" |
|||
echo "" |
@ -1,42 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_ut99install function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 011214 |
|||
|
|||
echo "Installing ${gamename} Server" |
|||
echo "=================================" |
|||
sleep 1 |
|||
mkdir -pv "${filesdir}" |
|||
cd "${filesdir}" |
|||
echo "Extracting ut-server-436.tar.gz" |
|||
sleep 1 |
|||
tar -zxvf ut-server-436.tar.gz ut-server/ --strip-components=1 |
|||
echo "Extracting UTPGPatch451.tar.bz2" |
|||
sleep 1 |
|||
tar -jxvf UTPGPatch451.tar.bz2 |
|||
while true; do |
|||
read -p "Was the install successful? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) break;; |
|||
[Nn]* ) fn_retryinstall;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
while true; do |
|||
read -p "Remove ut-server-436.tar.gz? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) rm -fv ut-server-436.tar.gz; break;; |
|||
[Nn]* ) break;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
while true; do |
|||
read -p "Remove UTPGPatch451.tar.bz2? [y/N]" yn |
|||
case $yn in |
|||
[Yy]* ) rm -fv UTPGPatch451.tar.bz2; break;; |
|||
[Nn]* ) break;; |
|||
* ) echo "Please answer yes or no.";; |
|||
esac |
|||
done |
|||
echo "" |
@ -1,26 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_validateserver function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: Runs a server validation. |
|||
|
|||
local modulename="Validate" |
|||
fn_rootcheck |
|||
fn_syscheck |
|||
fn_printwarn "Validating may overwrite some customised files." |
|||
sleep 1 |
|||
echo -en "\n" |
|||
echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate" |
|||
sleep 5 |
|||
echo -en "\n" |
|||
fn_printdots "Checking server files" |
|||
sleep 1 |
|||
fn_printok "Checking server files" |
|||
fn_scriptlog "Checking server files" |
|||
sleep 1 |
|||
cd "${rootdir}" |
|||
cd "steamcmd" |
|||
./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" |
|||
fn_scriptlog "Checking complete" |
@ -1,189 +0,0 @@ |
|||
#!/bin/bash |
|||
# LGSM fn_versioncheck function |
|||
# Author: Daniel Gibbs |
|||
# Website: http://danielgibbs.co.uk |
|||
# Version: 010115 |
|||
|
|||
# Description: Checks if a server update is available. |
|||
|
|||
local modulename="Update" |
|||
|
|||
fn_steamcmdcheck(){ |
|||
# Checks for server update from SteamCMD |
|||
fn_printdots "Checking for update: SteamCMD" |
|||
fn_scriptlog "Checking for update: SteamCMD" |
|||
sleep 1 |
|||
currentbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) |
|||
cd "${rootdir}/steamcmd" |
|||
availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_print ${appid} +app_info_print ${appid} +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"public\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) |
|||
if [ -z "${availablebuild}" ]; then |
|||
fn_printfail "Checking for update: SteamCMD" |
|||
fn_scriptlog "Failure! Checking for update: SteamCMD" |
|||
sleep 1 |
|||
fn_printfail "Checking for update: SteamCMD: Not returning version info" |
|||
fn_scriptlog "Failure! Checking for update: SteamCMD: Not returning version info" |
|||
sleep 2 |
|||
else |
|||
fn_printok "Checking for update: SteamCMD" |
|||
fn_scriptlog "Success! Checking for update: SteamCMD" |
|||
sleep 1 |
|||
fi |
|||
|
|||
if [ -z "${availablebuild}" ]; then |
|||
# Checks for server update from SteamDB.info if SteamCMD fails |
|||
echo "" |
|||
fn_printdots "Checking for update: SteamDB.info" |
|||
fn_scriptlog "Checking for update: SteamDB.info" |
|||
availablebuild=$(wget -qO- "http://steamdb.info/api/GetRawDepots/?appid=${appid}" | sed 's/\\n/\n/g' | grep -EA 1000 "^\s+\[branches\]" | grep -EA 5 "^\s+\[public\]" | grep -m 1 -EB 10 "^\s+\)$" | grep -E "^\s+\[buildid\]\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f4) |
|||
sleep 1 |
|||
if [ -z "${availablebuild}" ]; then |
|||
fn_printfail "Checking for update: SteamDB.info" |
|||
fn_scriptlog "Failure! Checking for update: SteamDB.info" |
|||
sleep 1 |
|||
fn_printfail "Checking for update: SteamDB.info: Not returning version info" |
|||
fn_scriptlog "Failure! Checking for update: SteamDB.info: Not returning version info" |
|||
sleep 2 |
|||
else |
|||
fn_printok "Checking for update: SteamDB.info" |
|||
fn_scriptlog "Success! Checking for update: SteamDB.info" |
|||
sleep 1 |
|||
fi |
|||
fi |
|||
if [ -z "${availablebuild}" ]; then |
|||
fn_logupdaterequest |
|||
fi |
|||
|
|||
if [ "${currentbuild}" -ne "${availablebuild}" ]; then |
|||
echo -e "\n" |
|||
echo -e "Update available:" |
|||
sleep 1 |
|||
echo -e " Current build: \e[0;31m${currentbuild}\e[0;39m" |
|||
echo -e " Available build: \e[0;32m${availablebuild}\e[0;39m" |
|||
echo -e "" |
|||
echo -e " https://steamdb.info/app/${appid}/" |
|||
sleep 1 |
|||
echo "" |
|||
echo -en "Applying update.\r" |
|||
sleep 1 |
|||
echo -en "Applying update..\r" |
|||
sleep 1 |
|||
echo -en "Applying update...\r" |
|||
sleep 1 |
|||
echo -en "\n" |
|||
fn_scriptlog "Update available" |
|||
fn_scriptlog "Current build: ${currentbuild}" |
|||
fn_scriptlog "Available build: ${availablebuild}" |
|||
fn_scriptlog "${currentbuild} > ${availablebuild}" |
|||
if [ ! -z "${norestart}" ]; then |
|||
fn_updateserver |
|||
else |
|||
fn_stopserver |
|||
fn_updateserver |
|||
fn_startserver |
|||
fi |
|||
else |
|||
echo -e "\n" |
|||
echo -e "No update available:" |
|||
echo -e " Current version: \e[0;32m${currentbuild}\e[0;39m" |
|||
echo -e " Available version: \e[0;32m${availablebuild}\e[0;39m" |
|||
echo -e " https://steamdb.info/app/${appid}/" |
|||
echo -e "" |
|||
fn_printoknl "No update available" |
|||
fn_scriptlog "Current build: ${currentbuild}" |
|||
fn_scriptlog "Available build: ${availablebuild}" |
|||
fi |
|||
} |
|||
|
|||
fn_logupdaterequest(){ |
|||
# Checks for server update requests from server logs. |
|||
echo "" |
|||
fn_printdots "Checking server logs for update requests" |
|||
sleep 1 |
|||
fn_printok "Checking server logs for update requests" |
|||
fn_scriptlog "Checking server logs for update requests" |
|||
sleep 1 |
|||
requestrestart=$(grep -sc "MasterRequestRestart" "${consolelog}") |
|||
if [ "${requestrestart}" -ge "1" ]; then |
|||
fn_printoknl "Server requesting update" |
|||
sleep 1 |
|||
echo "" |
|||
echo -ne "Applying update.\r" |
|||
sleep 1 |
|||
echo -ne "Applying update..\r" |
|||
sleep 1 |
|||
echo -ne "Applying update...\r" |
|||
sleep 1 |
|||
echo -ne "\n" |
|||
if [ ! -z "${norestart}" ]; then |
|||
fn_updateserver |
|||
else |
|||
fn_stopserver |
|||
fn_updateserver |
|||
fn_startserver |
|||
fi |
|||
else |
|||
fn_printok "No update request detected" |
|||
sleep 1 |
|||
fi |
|||
echo "" |
|||
exit |
|||
} |
|||
|
|||
|
|||
fn_appmanifestinfo(){ |
|||
appmanifestfile=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf") |
|||
appmanifestfilewc=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf"|wc -l) |
|||
} |
|||
|
|||
fn_appmanifestcheck(){ |
|||
fn_appmanifestinfo |
|||
# Multiple or no matching appmanifest files may sometimes be available. |
|||
# This is an error is corrected below if required. |
|||
if [ "${appmanifestfilewc}" -ge "2" ]; then |
|||
sleep 1 |
|||
fn_printwarn "Multiple appmanifest_${appid}.acf files found" |
|||
fn_scriptlog "Warning! Multiple appmanifest_${appid}.acf files found" |
|||
sleep 2 |
|||
fn_printdots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" |
|||
sleep 1 |
|||
for appfile in ${appmanifestfile}; do |
|||
rm "${appfile}" |
|||
done |
|||
appmanifestfilewc1="${appmanifestfilewc}" |
|||
fn_appmanifestinfo |
|||
if [ "${appmanifestfilewc}" -ge "2" ]; then |
|||
fn_printfail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" |
|||
fn_scriptlog "Failure! Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" |
|||
sleep 1 |
|||
echo "" |
|||
echo " Check user permissions" |
|||
for appfile in ${appmanifestfile}; do |
|||
echo " ${appfile}" |
|||
done |
|||
exit |
|||
else |
|||
sleep 1 |
|||
fn_printok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" |
|||
fn_scriptlog "Success! Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" |
|||
sleep 1 |
|||
fn_printinfonl "Forcing update to correct issue" |
|||
fn_scriptlog "Forcing update to correct issue" |
|||
sleep 1 |
|||
fn_updateserver |
|||
fn_versioncheck |
|||
fi |
|||
elif [ "${appmanifestfilewc}" -eq "0" ]; then |
|||
fn_printwarn "No appmanifest_${appid}.acf found" |
|||
fn_scriptlog "Warning! No appmanifest_${appid}.acf found" |
|||
sleep 2 |
|||
fn_printinfonl "Forcing update to correct issue" |
|||
fn_scriptlog "Forcing update to correct issue" |
|||
sleep 1 |
|||
fn_updateserver |
|||
fn_versioncheck |
|||
fi |
|||
} |
|||
|
|||
fn_printdots "Checking for update" |
|||
fn_appmanifestcheck |
|||
fn_steamcmdcheck |
Loading…
Reference in new issue