diff --git a/functions/fn_details b/functions/fn_details index 845eafca4..ea408876d 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -2,7 +2,7 @@ # LGSM fn_details function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 301015 +# Version: 281015 # Description: Displays server infomation. @@ -20,7 +20,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = echo -e "\e[34mHostname:\t\e[0m$HOSTNAME" echo -e "\e[34mtmux:\t\e[0m${tmuxv}" echo -e "\e[34mGLIBC:\t\e[0m${glibcv}" -} | column -s $'\t' -t +} >> .fn_details_distro +column -s $'\t' -t .fn_details_distro +rm -f .fn_details_distro } fn_details_performance(){ @@ -30,13 +32,17 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = { echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m" echo -e "\e[34mAvg Load:\t\e[0m${load}" -} | column -s $'\t' -t +} >> .fn_details_performance +column -s $'\t' -t .fn_details_performance +rm -f .fn_details_performance echo -e "" { echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m" echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m" echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m" -} | column -s $'\t' -t +} >> .fn_details_performance +column -s $'\t' -t .fn_details_performance +rm -f .fn_details_performance } fn_details_disk(){ @@ -52,7 +58,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = if [ -d "${backupdir}" ]; then echo -e "\e[34mBackups:\t\e[0m${backupdirdu}" fi -} | column -s $'\t' -t +} >> .fn_details_disk +column -s $'\t' -t .fn_details_disk +rm -f .fn_details_disk } fn_details_gameserver(){ @@ -124,7 +132,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = if [ -n "${dbplugin}" ]; then echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}" fi -} | column -s $'\t' -t +} >> .fn_details_gameserver +column -s $'\t' -t .fn_details_gameserver +rm -f .fn_details_gameserver echo -e "" ## script details @@ -144,7 +154,7 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = # GLIBC required if [ -n "${glibcrequired}" ]; then - if [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt "$(echo "${glibcrequired}" | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" ]; then + if [ "$(ldd --version | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" -lt "$(echo "${glibcrequired}" | sed -n '1 p' | tr -cd [:digit:] | tail -c 3)" ]; then if [ "${glibcfix}" == "yes" ]; then echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)" else @@ -177,7 +187,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = if [ -n "${networkcfgfullpath}" ]; then echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}" fi -} | column -s $'\t' -t +} >> .fn_details_script +column -s $'\t' -t .fn_details_script +rm -f .fn_details_script } fn_details_backup(){ @@ -193,7 +205,9 @@ else echo -e "\e[34m date:\t\e[0m${lastbackupdate}" echo -e "\e[34m file:\t\e[0m${lastbackup}" echo -e "\e[34m size:\t\e[0m${lastbackupsize}" - } | column -s $'\t' -t + } >> .fn_details_backup + column -s $'\t' -t .fn_details_backup + rm -f .fn_details_backup fi } @@ -246,8 +260,9 @@ echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Game\tINBOUND\t${port}\tudp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -273,8 +288,9 @@ echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Game\tINBOUND\t${port}\tudp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -300,8 +316,9 @@ echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Game\tINBOUND\t${port}\tudp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -336,8 +353,9 @@ fi echo -e "> Game\tINBOUND\t${port}\tudp" echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -366,8 +384,9 @@ echo -e "" echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Game/RCON\tINBOUND\t${port}\ttcp" echo -e "> Query\tINBOUND\t${queryport}\tudp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -398,8 +417,9 @@ echo -e "" echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" fi echo -e "< Client\tOUTBOUND\t${clientport}\tudp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -429,7 +449,9 @@ echo -e "" echo -e "> Game/RCON\tINBOUND\t${port}\tudp" echo -e "> Query\tINBOUND\t${queryport}\tudp" echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" -} | column -s $'\t' -t +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports echo -e "" echo -e "\e[92m${servername} WebAdmin\e[0m" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = @@ -437,8 +459,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html" echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}" echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -467,8 +490,9 @@ echo -e "" echo -e "> Game\tINBOUND\t${port}\ttcp" echo -e "> Query\tINBOUND\t${queryport}\ttcp" echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -496,8 +520,9 @@ echo -e "" echo -e "> Voice\tINBOUND\t${port}\tudp" echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -524,8 +549,9 @@ echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Game\tINBOUND\t${port}\ttcp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -554,8 +580,9 @@ echo -e "" echo -e "> Game\tINBOUND\t${port}\ttcp" echo -e "> Query\tINBOUND\t${queryport}\ttcp" echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -586,7 +613,9 @@ echo -e "" echo -e "> Query\tINBOUND\t${queryport}\tudp" echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" -} | column -s $'\t' -t +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports echo -e "" echo -e "\e[92m${servername} WebAdmin\e[0m" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = @@ -594,7 +623,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" -} | column -s $'\t' -t +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports echo -e "" echo -e "\e[92m${servername} Telnet\e[0m" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = @@ -602,8 +633,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}" echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}" echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } @@ -651,7 +683,9 @@ echo -e "" fi fi echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" -} | column -s $'\t' -t +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports echo -e "" echo -e "\e[92m${servername} WebAdmin\e[0m" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = @@ -660,8 +694,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}" echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" -} | column -s $'\t' -t - +} >> .fn_details_webadmin +column -s $'\t' -t .fn_details_webadmin +rm -f .fn_details_webadmin fn_details_statusbottom } @@ -690,8 +725,9 @@ echo -e "" echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" echo -e "> Query\tINBOUND\t${queryport}\tudp" -} | column -s $'\t' -t - +} >> .fn_details_ports +column -s $'\t' -t .fn_details_ports +rm -f .fn_details_ports fn_details_statusbottom } diff --git a/functions/fn_details_config b/functions/fn_details_config index 815153f23..f8727f1f5 100644 --- a/functions/fn_details_config +++ b/functions/fn_details_config @@ -8,7 +8,7 @@ ## Examples of filtering to get info from config files # sed 's/foo//g' - remove foo -# tr -cd '[:digit:]' leave only digits +# tr -cd [:digit:] leave only digits # tr -d '=\"; ' remove selected charectors =\"; # grep -v "foo" filter out lines that contain foo @@ -52,7 +52,7 @@ if [ "${engine}" == "avalanche" ]; then # slots if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "MaxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') + slots=$(grep "MaxPlayers" "${servercfgfullpath}" | tr -cd "[:digit:]") if [ ! -n "${slots}" ]; then slots="NOT SET" fi @@ -62,7 +62,7 @@ if [ "${engine}" == "avalanche" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "BindPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "BindPort" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -95,7 +95,7 @@ elif [ "${engine}" == "dontstarve" ]; then # slots if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd "[:digit:]") if [ ! -n "${slots}" ]; then slots="NOT SET" fi @@ -115,7 +115,7 @@ elif [ "${engine}" == "dontstarve" ]; then # tickrate if [ -f "${servercfgfullpath}" ]; then - tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd "[:digit:]") if [ ! -n "${tickrate}" ]; then tickrate="NOT SET" fi @@ -125,7 +125,7 @@ elif [ "${engine}" == "dontstarve" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -148,7 +148,7 @@ elif [ "${engine}" == "projectzomboid" ]; then # slots if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | grep -v "#" | tr -cd "[:digit:]") if [ ! -n "${slots}" ]; then slots="NOT SET" fi @@ -158,7 +158,7 @@ elif [ "${engine}" == "projectzomboid" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -201,7 +201,7 @@ elif [ "${engine}" == "realvirtuality" ]; then # slots if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd "[:digit:]") if [ ! -n "${slots}" ]; then slots="NOT SET" fi @@ -211,7 +211,7 @@ elif [ "${engine}" == "realvirtuality" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "serverport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd '[:digit:]') + port=$(grep "serverport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -219,7 +219,7 @@ elif [ "${engine}" == "realvirtuality" ]; then # query port if [ -f "${servercfgfullpath}" ]; then - queryport=$(grep "steamqueryport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd '[:digit:]') + queryport=$(grep "steamqueryport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd "[:digit:]") fi if [ ! -n "${queryport}" ]; then queryport="0" @@ -227,7 +227,7 @@ elif [ "${engine}" == "realvirtuality" ]; then # master port if [ -f "${servercfgfullpath}" ]; then - masterport=$(grep "steamport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd '[:digit:]') + masterport=$(grep "steamport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd "[:digit:]") fi if [ ! -n "${masterport}" ]; then masterport="0" @@ -259,7 +259,7 @@ elif [ "${engine}" == "seriousengine35" ]; then # slots if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd "[:digit:]") if [ ! -n "${slots}" ]; then slots="NOT SET" fi @@ -279,7 +279,7 @@ elif [ "${engine}" == "seriousengine35" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "prj_uwPort" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') + port=$(grep "prj_uwPort" "${servercfgfullpath}" | tr -d '\r' | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -309,7 +309,7 @@ elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsource" ]; then # server password if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed 's/sv_password //g' | sed 's/"//g') + serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed 's/sv_password//g' | sed 's/"//g') if [ ! -n "${serverpassword}" ]; then serverpassword="NOT SET" fi @@ -364,7 +364,7 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "default_voice_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "default_voice_port=" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="9987" @@ -372,7 +372,7 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then # query port if [ -f "${servercfgfullpath}" ]; then - queryport=$(grep "query_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "query_port=" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${queryport}" ]; then queryport="10011" @@ -380,7 +380,7 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then # file port if [ -f "${servercfgfullpath}" ]; then - fileport=$(grep "filetransfer_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + fileport=$(grep "filetransfer_port=" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${fileport}" ]; then fileport="30033" @@ -422,7 +422,7 @@ elif [ "${engine}" == "teeworlds" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="8303" @@ -430,7 +430,7 @@ elif [ "${engine}" == "teeworlds" ]; then # slots if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd '[:digit:]') + slots=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd "[:digit:]") if [ ! -n "${slots}" ]; then slots="12" fi @@ -444,7 +444,7 @@ elif [ "${engine}" == "terraria" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "port=" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -484,7 +484,7 @@ elif [ "${engine}" == "unity3d" ]; then # webadmin port if [ -f "${servercfgfullpath}" ]; then - webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${webadminport}" ]; then webadminport="0" @@ -522,7 +522,7 @@ elif [ "${engine}" == "unity3d" ]; then # telnet port if [ -f "${servercfgfullpath}" ]; then - telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${telnetport}" ]; then telnetport="0" @@ -540,7 +540,7 @@ elif [ "${engine}" == "unity3d" ]; then # slots if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') + slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd "[:digit:]") if [ ! -n "${slots}" ]; then slots="NOT SET" fi @@ -570,7 +570,7 @@ elif [ "${engine}" == "unity3d" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -620,7 +620,7 @@ elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "Port=" "${servercfgfullpath}" | grep -v "Master" | grep -v "LAN" | grep -v "Proxy" | grep -v "Listen" | tr -d '\r' | tr -cd '[:digit:]') + port=$(grep "Port=" "${servercfgfullpath}" | grep -v "Master" | grep -v "LAN" | grep -v "Proxy" | grep -v "Listen" | tr -d '\r' | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -636,7 +636,7 @@ elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then # gamespy query port if [ -f "${servercfgfullpath}" ]; then - gsqueryport=$(grep "OldQueryPortNumber=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') + gsqueryport=$(grep "OldQueryPortNumber=" "${servercfgfullpath}" | tr -d '\r' | tr -cd "[:digit:]") fi if [ ! -n "${gsqueryport}" ]; then gsqueryport="0" @@ -662,7 +662,7 @@ elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then # webadmin port if [ -f "${servercfgfullpath}" ]; then - webadminport=$(grep "ListenPort=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') + webadminport=$(grep "ListenPort=" "${servercfgfullpath}" | tr -d '\r' | tr -cd "[:digit:]") fi if [ ! -n "${webadminport}" ]; then webadminport="0" @@ -750,7 +750,7 @@ elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then # slots if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd "[:digit:]") if [ ! -n "${slots}" ]; then slots="NOT SET" fi @@ -760,7 +760,7 @@ elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then # port if [ -f "${servercfgfullpath}" ]; then - port=$(grep "Port=" "${servercfgfullpath}" | grep -v "RCONPort=" | grep -v "QueryPort=" | tr -cd '[:digit:]') + port=$(grep "Port=" "${servercfgfullpath}" | grep -v "RCONPort=" | grep -v "QueryPort=" | tr -cd "[:digit:]") fi if [ ! -n "${port}" ]; then port="0" @@ -768,7 +768,7 @@ elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then # rcon port if [ -f "${servercfgfullpath}" ]; then - rconport=$(grep "RCONPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + rconport=$(grep "RCONPort=" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${rconport}" ]; then rconport="0" @@ -776,7 +776,7 @@ elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then # query port if [ -f "${servercfgfullpath}" ]; then - queryport=$(grep "QueryPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "QueryPort=" "${servercfgfullpath}" | tr -cd "[:digit:]") fi if [ ! -n "${queryport}" ]; then queryport="0" diff --git a/functions/fn_details_distro b/functions/fn_details_distro index 4246d4a89..b11b27b14 100644 --- a/functions/fn_details_distro +++ b/functions/fn_details_distro @@ -2,7 +2,7 @@ # LGSM fn_details_distro function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 301015 +# Version: 270515 # Description: Variables providing useful info on the Operating System such as disk and performace info. # Used for fn_details, fn_debug and fn_email. diff --git a/functions/fn_getopt b/functions/fn_getopt index e495fc566..20007fcd1 100644 --- a/functions/fn_getopt +++ b/functions/fn_getopt @@ -2,227 +2,397 @@ # LGSM fn_getopt function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +# Version: 011115 # Description: getopt arguments. fn_getopt_generic(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update) + u|update) fn_update_check;; - force-update) + fu|force-update|update-restart) forceupdate=1; fn_update_check;; - update-restart) - forceupdate=1; - fn_update_check;; - update-functions) + uf|update-functions) fn_update_functions;; - validate) + v|validate) fn_validate;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - console) + c|console) fn_console;; - debug) + d|debug) fn_debug;; - install) + i|install) fn_install;; - auto-install) + ai|auto-install) fn_autoinstall;; - depsdetect) - fn_deps_detect;; + dd|depsdetect) + fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update|force-update|update-functions|validate|monitor|email-test|details|backup|console|debug|install|auto-install}" -esac + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "http://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "\e[93mCommands\e[0m" + { + echo -e "\e[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." + echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." + } | column -s $'\t' -t + esac exit } fn_getopt_teamspeak3(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update) + u|update) fn_update_check;; - update-functions) + uf|update-functions) fn_update_functions;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - install) + i|install) fn_install;; - auto-install) + ai|auto-install) fn_autoinstall;; - depsdetect) - fn_deps_detect;; + dd|depsdetect) + fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update|update-functions|monitor|email-test|details|backup|install|auto-install}" -esac + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "http://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "\e[93mCommands\e[0m" + { + echo -e "\e[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate\t\e[0mChecks and applies updates from teamspeak.com." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." + } | column -s $'\t' -t + esac exit } fn_getopt_mumble(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update-functions) + uf|update-functions) fn_update_functions;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - backup) + b|backup) fn_backup;; console) fn_console;; - debug) + d|debug) fn_debug;; - depsdetect) - fn_deps_detect;; + dd|depsdetect) + fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|backup|console|debug}" -esac + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "http://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "\e[93mCommands\e[0m" + { + echo -e "\e[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + } | column -s $'\t' -t + esac +exit +} + +fn_getopt_gmodserver(){ +case "$getopt" in + st|start) + fn_start;; + sp|stop) + fn_stop;; + r|restart) + fn_restart;; + u|update) + fn_update_check;; + fu|force-update|update-restart) + forceupdate=1; + fn_update_check;; + uf|update-functions) + fn_update_functions;; + v|validate) + fn_validate;; + m|monitor) + fn_monitor;; + et|email-test) + fn_email_test;; + d|details) + fn_details;; + b|backup) + fn_backup;; + c|console) + fn_console;; + d|debug) + fn_debug;; + i|install) + fn_install;; + ai|auto-install) + fn_autoinstall;; + dd|depsdetect) + fn_deps_detect;; + gc|gmod-content) + fn_content_gmod;; + *) + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "http://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "\e[93mCommands\e[0m" + { + echo -e "\e[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." + echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." + echo -e "\e[34mgmod-content\t\e[0mDownload gmod add-on content." + } | column -s $'\t' -t + esac exit } fn_getopt_unreal(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update-functions) + uf|update-functions) fn_update_functions;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - console) + c|console) fn_console;; - debug) + d|debug) fn_debug;; - install) + i|install) fn_install;; - map-compressor) + mc|map-compressor) fn_compress_ut99maps;; - depsdetect) + dd|depsdetect) fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|details|backup|console|debug|install|map-compressor}" -esac + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "http://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "\e[93mCommands\e[0m" + { + echo -e "\e[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." + } | column -s $'\t' -t + esac exit } fn_getopt_unreal2(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update) - fn_update_check;; - force-update) - forceupdate=1; + u|update) fn_update_check;; - update-restart) + fu|force-update|update-restart) forceupdate=1; fn_update_check;; - update-functions) + uf|update-functions) fn_update_functions;; - validate) + v|validate) fn_validate;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - console) + c|console) fn_console;; - debug) + d|debug) fn_debug;; - install) + i|install) fn_install;; - auto-install) + ai|auto-install) fn_autoinstall;; - map-compressor) + dd|depsdetect) + fn_deps_detect;; + mc|map-compressor) fn_compress_unreal2maps;; - depsdetect) - fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update|update-functions|validate|monitor|email-test|details|backup|console|debug|install|auto-install|map-compressor}" -esac + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "http://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "\e[93mCommands\e[0m" + { + echo -e "\e[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." + echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." + echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." + } | column -s $'\t' -t + esac exit } fn_getopt_ut2k4(){ case "$getopt" in - start) + st|start) fn_start;; - stop) + sp|stop) fn_stop;; - restart) + r|restart) fn_restart;; - update-functions) + uf|update-functions) fn_update_functions;; - monitor) + m|monitor) fn_monitor;; - email-test) + et|email-test) fn_email_test;; - details) + d|details) fn_details;; - backup) + b|backup) fn_backup;; - console) + c|console) fn_console;; - debug) + d|debug) fn_debug;; - install) + i|install) fn_install;; - map-compressor) - fn_compress_unreal2maps;; - depsdetect) + mc|map-compressor) + fn_compress_ut99maps;; + dd|depsdetect) fn_deps_detect;; *) - echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|details|backup|console|debug|install|map-compressor}" -esac + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "http://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "\e[93mCommands\e[0m" + { + echo -e "\e[34mstart\t\e[0mStart the server." + echo -e "\e[34mstop\t\e[0mStop the server." + echo -e "\e[34mrestart\t\e[0mRestart the server." + echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." + echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." + echo -e "\e[34memail-test\t\e[0mSends test monitor email." + echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." + echo -e "\e[34mbackup\t\e[0mCreate archive of the server." + echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." + echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." + echo -e "\e[34minstall\t\e[0mInstall the server." + echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." + } | column -s $'\t' -t + esac exit } diff --git a/functions/fn_install_glibcfix b/functions/fn_install_glibcfix index 18f1b0840..52868e908 100644 --- a/functions/fn_install_glibcfix +++ b/functions/fn_install_glibcfix @@ -2,7 +2,7 @@ # LGSM fn_install_glibcfix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 301015 +# Version: 050715 fn_glibcfixmsg(){ echo "" @@ -48,7 +48,7 @@ if [ -z $(command -v ldd) ]; then esac done # if Glibc less than 1.15 -elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 215 ]; then +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" @@ -110,7 +110,7 @@ elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 21 wget -nv -N https://github.com/dgibbs64/linuxgsm/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 + 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" diff --git a/functions/fn_install_ts3 b/functions/fn_install_ts3 index bde40acfe..81c229f88 100644 --- a/functions/fn_install_ts3 +++ b/functions/fn_install_ts3 @@ -2,7 +2,7 @@ # LGSM fn_install_ts3 function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +# Version: 270715 fn_details_distro # Gets the teamspeak server architecture @@ -19,7 +19,7 @@ fi wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > .ts3_version_numbers_unsorted.tmp # removes digits to allow sorting of numbers -cat .ts3_version_numbers_unsorted.tmp |tr -cd '[:digit:][*\n]' > .ts3_version_numbers_digit.tmp +cat .ts3_version_numbers_unsorted.tmp |tr -cd "[:digit:][*\n]" > .ts3_version_numbers_digit.tmp # Sorts numbers in to correct order # merges two files in to one with two columns sorts the numbers in to order then only outputs the second to the ts3_version_numbers.tmp paste .ts3_version_numbers_digit.tmp .ts3_version_numbers_unsorted.tmp |sort -rn|awk '{ print $2 }' > .ts3_version_numbers.tmp diff --git a/functions/fn_monitor_query b/functions/fn_monitor_query index f56b6cf23..33b158ac3 100644 --- a/functions/fn_monitor_query +++ b/functions/fn_monitor_query @@ -2,7 +2,7 @@ # LGSM fn_monitor_query function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +# Version: 030715 # Description: uses gsquery.py to directly query the server. # Detects if the server has frozen. @@ -10,15 +10,15 @@ local modulename="Monitor" if [ -f "${rootdir}/gsquery.py" ]; then if [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - gameport=$(grep Port= "${servercfgfullpath}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|tr -d '\r'|tr -cd '[:digit:]') + gameport=$(grep Port= "${servercfgfullpath}"|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:]') + 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:]') + gameport=$(grep ServerPort "${servercfgfullpath}"|tr -cd [:digit:]) port=$((${gameport} + 1)) fi fn_printinfo "Detected gsquery.py" diff --git a/functions/fn_start b/functions/fn_start index 66d9ae355..8bb90da71 100644 --- a/functions/fn_start +++ b/functions/fn_start @@ -2,7 +2,7 @@ # LGSM fn_start function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 301015 +# Version: 291015 # Description: Starts the server. @@ -126,11 +126,11 @@ 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:]')" -lt "16" ]; then +if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd [:digit:])" -lt "16" ]; then echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}" echo "http://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" echo "Currently installed: $(tmux -V)" >> "${consolelog}" -elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then +elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd [:digit:])" -eq "18" ]; then echo "Console logging disabled: Bug in tmux 1.8 breaks logging" >> "${consolelog}" echo "http://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" echo "Currently installed: $(tmux -V)" >> "${consolelog}" diff --git a/functions/fn_update_check b/functions/fn_update_check index 443a88f1c..6ac663ef6 100644 --- a/functions/fn_update_check +++ b/functions/fn_update_check @@ -2,7 +2,11 @@ # LGSM fn_update_check function # Author: Daniel Gibbs # Website: http://gameservermanagers.com +<<<<<<< HEAD +# Version: 281015 +======= # Version: 311015 +>>>>>>> refs/remotes/origin/master # Description: Checks if a server update is available. @@ -219,7 +223,7 @@ ts3arch=$(ls $(find ${filesdir}/ -name 'ts3server_*_*' 2> /dev/null | grep -v 't wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > .ts3_version_numbers_unsorted.tmp # removes digits to allow sorting of numbers -cat .ts3_version_numbers_unsorted.tmp |tr -cd '[:digit:][*\n]' > .ts3_version_numbers_digit.tmp +cat .ts3_version_numbers_unsorted.tmp |tr -cd "[:digit:][*\n]" > .ts3_version_numbers_digit.tmp # Sorts numbers in to correct order # merges two files in to one with two columns sorts the numbers in to order then only outputs the second to the ts3_version_numbers.tmp paste .ts3_version_numbers_digit.tmp .ts3_version_numbers_unsorted.tmp |sort -rn|awk '{ print $2 }' > .ts3_version_numbers.tmp @@ -253,8 +257,8 @@ else fi # Removes dots so if can compare version numbers -currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') -availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') +currentbuilddigit=$(echo "${currentbuild}"|tr -cd "[:digit:]") +availablebuilddigit=$(echo "${availablebuild}"|tr -cd "[:digit:]") if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then echo -e "\n" echo -e "Update available:"