| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700 |
- #!/bin/bash
- # LinuxGSM info_messages.sh module
- # Author: Daniel Gibbs
- # Contributors: http://linuxgsm.com/contrib
- # Website: https://linuxgsm.com
- # Description: Defines server info messages for details and alerts.
- functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
- # Separator is different for details
- fn_messages_separator(){
- if [ "${commandname}" == "DETAILS" ]; then
- printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
- else
- echo -e "================================="
- fi
- }
- # Removes the passwords form all but details.
- fn_info_message_password_strip(){
- if [ "${commandname}" != "DETAILS" ]; then
- if [ "${serverpassword}" ]; then
- serverpassword="********"
- fi
- if [ "${rconpassword}" ]; then
- rconpassword="********"
- fi
- if [ "${adminpassword}" ]; then
- adminpassword="********"
- fi
- if [ "${statspassword}" ]; then
- statspassword="********"
- fi
- if [ "${webadminpass}" ]; then
- webadminpass="********"
- fi
- if [ "${telnetpass}" ]; then
- telnetpass="********"
- fi
- if [ "${wsapikey}" ]; then
- wsapikey="********"
- fi
- if [ "${gslt}" ]; then
- gslt="********"
- fi
- fi
- }
- # Alert Summary
- # used with alertlog
- fn_info_message_head(){
- echo -e ""
- echo -e "${lightyellow}Alert Summary${default}"
- fn_messages_separator
- echo -e "Message"
- echo -e "${alertbody}"
- echo -e ""
- echo -e "Game"
- echo -e "${gamename}"
- echo -e ""
- echo -e "Server name"
- echo -e "${servername}"
- echo -e ""
- echo -e "Hostname"
- echo -e "${HOSTNAME}"
- echo -e ""
- echo -e "Server IP"
- echo -e "${ip}:${port}"
- }
- fn_info_message_distro(){
- #
- # Distro Details
- # =================================
- # Date: Sun 21 Feb 2021 09:22:53 AM UTC
- # Distro: Ubuntu 20.04.2 LTS
- # Arch: x86_64
- # Kernel: 5.4.0-65-generic
- # Hostname: server
- # Uptime: 16d, 5h, 18m
- # tmux: tmux 3.0a
- # glibc: 2.31
- echo -e ""
- echo -e "${lightyellow}Distro Details${default}"
- fn_messages_separator
- {
- echo -e "${lightblue}Date:\t${default}${date}"
- echo -e "${lightblue}Distro:\t${default}${distroname}"
- echo -e "${lightblue}Arch:\t${default}${arch}"
- echo -e "${lightblue}Kernel:\t${default}${kernel}"
- echo -e "${lightblue}Hostname:\t${default}${HOSTNAME}"
- echo -e "${lightblue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m"
- echo -e "${lightblue}tmux:\t${default}${tmuxv}"
- echo -e "${lightblue}glibc:\t${default}${glibcversion}"
- } | column -s $'\t' -t
- }
- fn_info_message_server_resource(){
- #
- # Server Resource
- # =================================
- # CPU
- # Model: AMD EPYC 7601 32-Core Processor
- # Cores: 2
- # Frequency: 2199.994MHz
- # Avg Load: 0.01, 0.05, 0.18
- #
- # Memory
- # Mem: total used free cached available
- # Physical: 3.9GB 350MB 3.3GB 3.2GB 3.3GB
- # Swap: 512MB 55MB 458MB
- #
- # Storage
- # Filesystem: /dev/sda
- # Total: 79G
- # Used: 73G
- # Available: 1.4G
- #
- # Network
- # IP: 0.0.0.0
- # Internet IP: 176.58.124.96
- echo -e ""
- echo -e "${lightyellow}Server Resource${default}"
- fn_messages_separator
- {
- echo -e "${lightyellow}CPU\t${default}"
- echo -e "${lightblue}Model:\t${default}${cpumodel}"
- echo -e "${lightblue}Cores:\t${default}${cpucores}"
- echo -e "${lightblue}Frequency:\t${default}${cpufreqency}MHz"
- echo -e "${lightblue}Avg Load:\t${default}${load}"
- } | column -s $'\t' -t
- echo -e ""
- {
- echo -e "${lightyellow}Memory\t${default}"
- echo -e "${lightblue}Mem:\t${lightblue}total\tused\tfree\tcached\tavailable${default}"
- echo -e "${lightblue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}"
- echo -e "${lightblue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
- } | column -s $'\t' -t
- echo -e ""
- {
- echo -e "${lightyellow}Storage${default}"
- echo -e "${lightblue}Filesystem:\t${default}${filesystem}"
- echo -e "${lightblue}Total:\t\t${default}${totalspace}"
- echo -e "${lightblue}Used:\t\t${default}${usedspace}"
- echo -e "${lightblue}Available:\t${default}${availspace}"
- } | column -s $'\t' -t
- echo -e ""
- {
- echo -e "${lightyellow}Network${default}"
- if [ -n "${netint}" ]; then
- echo -e "${lightblue}Interface:\t${default}${netint}"
- fi
- if [ -n "${netlink}" ]; then
- echo -e "${lightblue}Link Speed:\t${default}${netlink}"
- fi
- echo -e "${lightblue}IP:\t${default}${ip}"
- if [ "${ip}" != "${extip}" ]; then
- echo -e "${lightblue}Internet IP:\t${default}${extip}"
- fi
- } | column -s $'\t' -t
- }
- fn_info_message_gameserver_resource(){
- #
- # Game Server Resource Usage
- # =================================
- # CPU Used: 1.1%
- # Mem Used: 4.8% 189MB
- #
- # Storage
- # Total: 241M
- # Serverfiles: 240M
- # Backups: 24K
- echo -e ""
- echo -e "${lightyellow}Game Server Resource Usage${default}"
- fn_messages_separator
- {
- if [ "${status}" != "0" ]&&[ -v status ]; then
- if [ -n "${cpuused}" ]; then
- echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}"
- else
- echo -e "${lightblue}CPU Used:\t${red}unknown${default}"
- fi
- if [ -n "${memused}" ]; then
- echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}MB${default}"
- else
- echo -e "${lightblue}Mem Used:\t${default}${pmemused}\t${red}unknown${default}"
- fi
- else
- echo -e "${lightblue}CPU Used:\t${default}0%${default}"
- echo -e "${lightblue}Mem Used:\t${default}0%\t0MB${default}"
- fi
- } | column -s $'\t' -t
- echo -e ""
- {
- echo -e "${lightyellow}Storage${default}"
- echo -e "${lightblue}Total:\t${default}${rootdirdu}"
- echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}"
- if [ -d "${backupdir}" ]; then
- echo -e "${lightblue}Backups:\t${default}${backupdirdu}"
- fi
- } | column -s $'\t' -t
- }
- fn_info_message_gameserver(){
- #
- # Counter-Strike: Global Offensive Server Details
- # =================================
- # Server name: LinuxGSM
- # Server IP: 0.0.0.0:27015
- # Internet IP: 176.48.124.96:34197
- # Server password: NOT SET
- # RCON password: adminF54CC0VR
- # Players: 0/16
- # Current map: de_mirage
- # Default map: de_mirage
- # Game type: 0
- # Game mode: 0
- # Tick rate: 64
- # Master Server: listed
- # Status: STARTED
- echo -e ""
- echo -e "${lightgreen}${gamename} Server Details${default}"
- fn_info_message_password_strip
- fn_messages_separator
- {
- # Server name
- if [ -n "${gdname}" ]; then
- echo -e "${lightblue}Server name:\t${default}${gdname}"
- elif [ -n "${servername}" ]; then
- echo -e "${lightblue}Server name:\t${default}${servername}"
- fi
- # Server description
- if [ -n "${serverdescription}" ]; then
- echo -e "${lightblue}Server Description:\t${default}${serverdescription}"
- fi
- # Appid
- if [ -n "${appid}" ]; then
- echo -e "${lightblue}App ID:\t${default}${appid}"
- fi
- # Branch
- if [ -n "${branch}" ]; then
- echo -e "${lightblue}Branch:\t${default}${branch}"
- fi
- # Beta Password
- if [ -n "${betapassword}" ]; then
- echo -e "${lightblue}Beta Password:\t${default}${betapassword}"
- fi
- # Server ip
- echo -e "${lightblue}Server IP:\t${default}${ip}:${port}"
- # Internet ip
- if [ -n "${extip}" ]; then
- if [ "${ip}" != "${extip}" ]; then
- echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}"
- fi
- fi
- # Display ip
- if [ -n "${displayip}" ]; then
- echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}"
- fi
- # Server password
- if [ -n "${serverpassword}" ]; then
- echo -e "${lightblue}Server password:\t${default}${serverpassword}"
- fi
- # Query enabled (Starbound)
- if [ -n "${queryenabled}" ]; then
- echo -e "${lightblue}Query enabled:\t${default}${queryenabled}"
- fi
- # RCON enabled (Starbound)
- if [ -n "${rconenabled}" ]; then
- echo -e "${lightblue}RCON enabled:\t${default}${rconenabled}"
- fi
- # RCON password
- if [ -n "${rconpassword}" ]; then
- echo -e "${lightblue}RCON password:\t${default}${rconpassword}"
- fi
- # RCON web (Rust)
- if [ -n "${rconweb}" ]; then
- echo -e "${lightblue}RCON web:\t${default}${rconweb}"
- fi
- # Admin password
- if [ -n "${adminpassword}" ]; then
- echo -e "${lightblue}Admin password:\t${default}${adminpassword}"
- fi
- # Stats password (Quake Live)
- if [ -n "${statspassword}" ]; then
- echo -e "${lightblue}Stats password:\t${default}${statspassword}"
- fi
- # Players
- if [ "${querystatus}" != "0" ]; then
- if [ -n "${maxplayers}" ]; then
- echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}"
- fi
- else
- if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
- echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}"
- elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then
- echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}"
- elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
- echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}"
- elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then
- echo -e "${lightblue}Players:\t${default}${gdplayers}/∞"
- elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then
- echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}"
- fi
- fi
- # Bots
- if [ -n "${gdbots}" ]; then
- echo -e "${lightblue}Bots:\t${default}${gdbots}"
- fi
- # Current map
- if [ -n "${gdmap}" ]; then
- echo -e "${lightblue}Current map:\t${default}${gdmap}"
- fi
- # Default map
- if [ -n "${defaultmap}" ]; then
- echo -e "${lightblue}Default map:\t${default}${defaultmap}"
- fi
- if [ -n "${defaultscenario}" ]; then
- # Current scenario
- if [ -n "${gdgamemode}" ]; then
- echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}"
- fi
- else
- # Current game mode
- if [ -n "${gdgamemode}" ]; then
- echo -e "${lightblue}Current game mode:\t${default}${gdgamemode}"
- fi
- fi
- # Default scenario
- if [ -n "${defaultscenario}" ]; then
- echo -e "${lightblue}Default scenario:\t${default}${defaultscenario}"
- fi
- # Game type
- if [ -n "${gametype}" ]; then
- echo -e "${lightblue}Game type:\t${default}${gametype}"
- fi
- # Game mode
- if [ -n "${gamemode}" ]; then
- echo -e "${lightblue}Game mode:\t${default}${gamemode}"
- fi
- # Game world
- if [ -n "${gameworld}" ]; then
- echo -e "${lightblue}Game world:\t${default}${gameworld}"
- fi
- # Tick rate
- if [ -n "${tickrate}" ]; then
- echo -e "${lightblue}Tick rate:\t${default}${tickrate}"
- fi
- # Sharding (Don't Starve Together)
- if [ -n "${sharding}" ]; then
- echo -e "${lightblue}Sharding:\t${default}${sharding}"
- fi
- # Master (Don't Starve Together)
- if [ -n "${master}" ]; then
- echo -e "${lightblue}Master:\t${default}${master}"
- fi
- # Shard (Don't Starve Together)
- if [ -n "${shard}" ]; then
- echo -e "${lightblue}Shard:\t${default}${shard}"
- fi
- # Cluster (Don't Starve Together)
- if [ -n "${cluster}" ]; then
- echo -e "${lightblue}Cluster:\t${default}${cluster}"
- fi
- # Cave (Don't Starve Together)
- if [ -n "${cave}" ]; then
- echo -e "${lightblue}Cave:\t${default}${cave}"
- fi
- # Creativemode (Hurtworld)
- if [ -n "${creativemode}" ]; then
- echo -e "${lightblue}Creativemode:\t${default}${creativemode}"
- fi
- # TeamSpeak dbplugin
- if [ -n "${dbplugin}" ]; then
- echo -e "${lightblue}dbplugin:\t${default}${dbplugin}"
- fi
- # ASE (Multi Theft Auto)
- if [ -n "${ase}" ]; then
- echo -e "${lightblue}ASE:\t${default}${ase}"
- fi
- # Save interval (Rust)
- if [ -n "${saveinterval}" ]; then
- echo -e "${lightblue}ASE:\t${default}${saveinterval} s"
- fi
- # Random map rotation mode (Squad and Post Scriptum)
- if [ -n "${randommap}" ]; then
- echo -e "${lightblue}Map rotation:\t${default}${randommap}"
- fi
- # Server Version (Jedi Knight II: Jedi Outcast)
- if [ -n "${serverversion}" ]; then
- echo -e "${lightblue}Server Version:\t${default}${serverversion}"
- fi
- # authentication token (Factorio)
- if [ -n "${authtoken}" ]; then
- echo -e "${lightblue}Auth Token:\t${default}${authtoken}"
- fi
- # savegameinterval (Factorio)
- if [ -n "${savegameinterval}" ]; then
- echo -e "${lightblue}Savegame Interval:\t${default}${savegameinterval}"
- fi
- # versioncount (Factorio)
- if [ -n "${versioncount}" ]; then
- echo -e "${lightblue}Version Count:\t${default}${versioncount}"
- fi
- # Listed on Master server
- if [ -n "${displaymasterserver}" ]; then
- if [ "${displaymasterserver}" == "true" ]; then
- echo -e "${lightblue}Master server:\t${green}listed${default}"
- else
- echo -e "${lightblue}Master server:\t${red}not listed${default}"
- fi
- fi
- # Game server status
- if [ "${status}" == "0" ]; then
- echo -e "${lightblue}Status:\t${red}STOPPED${default}"
- else
- echo -e "${lightblue}Status:\t${green}STARTED${default}"
- fi
- } | column -s $'\t' -t
- echo -e ""
- }
- fn_info_message_script(){
- # csgoserver Script Details
- # =================================
- # Script name: csgoserver
- # LinuxGSM version: v21.1.3
- # glibc required: 2.18
- # Discord alert: off
- # Email alert: off
- # IFTTT alert: off
- # Mailgun (email) alert: off
- # Pushbullet alert: off
- # Pushover alert: off
- # Rocketchat alert: off
- # Slack alert: off
- # Telegram alert: off
- # Update on start: off
- # User: lgsm
- # Location: /home/lgsm/csgoserver
- # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg
- echo -e "${lightgreen}${selfname} Script Details${default}"
- fn_messages_separator
- {
- # Script name
- echo -e "${lightblue}Script name:\t${default}${selfname}"
- # LinuxGSM version
- if [ -n "${version}" ]; then
- echo -e "${lightblue}LinuxGSM version:\t${default}${version}"
- fi
- # glibc required
- if [ -n "${glibc}" ]; then
- if [ "${glibc}" == "null" ]; then
- # Glibc is not required.
- :
- elif [ -z "${glibc}" ]; then
- echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}"
- elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then
- echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})"
- else
- echo -e "${lightblue}glibc required:\t${green}${glibc}${default}"
- fi
- fi
- # Discord alert
- echo -e "${lightblue}Discord alert:\t${default}${discordalert}"
- # Email alert
- echo -e "${lightblue}Email alert:\t${default}${emailalert}"
- # IFTTT alert
- echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}"
- # Mailgun alert
- echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}"
- # Pushbullet alert
- echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"
- # Pushover alert
- echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}"
- # Rocketchat alert
- echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}"
- # Slack alert
- echo -e "${lightblue}Slack alert:\t${default}${slackalert}"
- # Telegram alert
- echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}"
- # Update on start
- if [ -n "${updateonstart}" ]; then
- echo -e "${lightblue}Update on start:\t${default}${updateonstart}"
- fi
- # User
- echo -e "${lightblue}User:\t${default}$(whoami)"
- # Script location
- echo -e "${lightblue}Location:\t${default}${rootdir}"
- # Config file location
- if [ -n "${servercfgfullpath}" ]; then
- if [ -f "${servercfgfullpath}" ]; then
- echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}"
- elif [ -d "${servercfgfullpath}" ]; then
- echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}"
- else
- echo -e "${lightblue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
- fi
- fi
- # Network config file location (ARMA 3)
- if [ -n "${networkcfgfullpath}" ]; then
- echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}"
- fi
- } | column -s $'\t' -t
- }
- fn_info_message_backup(){
- #
- # Backups
- # =================================
- # No. of backups: 1
- # Latest backup:
- # date: Fri May 6 18:34:19 UTC 2016
- # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
- # size: 945M
- echo -e ""
- echo -e "${lightgreen}Backups${default}"
- fn_messages_separator
- if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
- echo -e "No Backups created"
- else
- {
- echo -e "${lightblue}No. of backups:\t${default}${backupcount}"
- echo -e "${lightblue}Latest backup:${default}"
- if [ "${lastbackupdaysago}" == "0" ]; then
- echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)"
- elif [ "${lastbackupdaysago}" == "1" ]; then
- echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)"
- else
- echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)"
- fi
- echo -e "${lightblue} file:\t${default}${lastbackup}"
- echo -e "${lightblue} size:\t${default}${lastbackupsize}"
- } | column -s $'\t' -t
- fi
- }
- fn_info_message_commandlineparms(){
- #
- # Command-line Parameters
- # =================================
- # ./run_server_x86.sh +set net_strict 1
- echo -e ""
- echo -e "${lightgreen}Command-line Parameters${default}"
- fn_info_message_password_strip
- fn_messages_separator
- if [ "${serverpassword}" == "NOT SET" ]; then
- unset serverpassword
- fi
- if grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-${selfname}.cfg"; then
- eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")"
- elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/${selfname}.cfg"; then
- eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/${selfname}.cfg")"
- elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-common.cfg"; then
- eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-common.cfg")"
- elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/common.cfg"; then
- eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/common.cfg")"
- elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/_default.cfg"; then
- eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/_default.cfg")"
- fi
- echo -e "${preexecutable} ${executable} ${startparameters}"
- }
- fn_info_message_ports(){
- #
- # Ports
- # =================================
- # Change ports by editing the parameters in:
- # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
- echo -e ""
- echo -e "${lightgreen}Ports${default}"
- fn_messages_separator
- echo -e "${lightblue}Change ports by editing the parameters in:${default}"
- startparameterslocation="${red}UNKNOWN${default}"
- # engines/games that require editing in the config file.
- local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "Vintage Story" "wurm")
- for port_edit in "${ports_edit_array[@]}"; do
- if [ "${shortname}" == "ut3" ]; then
- startparameterslocation="${servercfgdir}/UTWeb.ini"
- elif [ "${shortname}" == "kf2" ]; then
- startparameterslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini"
- elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
- startparameterslocation="${servercfgfullpath}"
- fi
- done
- # engines/games that require editing the start parameters.
- local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "scpsl" "scpslsm" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" "vh" )
- for port_edit in "${ports_edit_array[@]}"; do
- if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
- startparameterslocation="${configdirserver}"
- fi
- done
- echo -e "${startparameterslocation}"
- echo -e ""
- echo -e "${lightblue}Useful port diagnostic command:${default}"
- }
- fn_info_message_statusbottom(){
- echo -e ""
- if [ "${status}" == "0" ]; then
- echo -e "${lightblue}Status:\t${red}STOPPED${default}"
- else
- echo -e "${lightblue}Status:\t${green}STARTED${default}"
- fi
- echo -e ""
- }
- fn_info_logs(){
- echo -e ""
- echo -e "${selfname} Logs"
- echo -e "================================="
- if [ -n "${lgsmlog}" ]; then
- echo -e "\nScript log\n==================="
- if [ ! "$(ls -A "${lgsmlogdir}")" ]; then
- echo -e "${lgsmlogdir} (NO LOG FILES)"
- elif [ ! -s "${lgsmlog}" ]; then
- echo -e "${lgsmlog} (LOG FILE IS EMPTY)"
- else
- echo -e "${lgsmlog}"
- tail -25 "${lgsmlog}"
- fi
- echo -e ""
- fi
- if [ -n "${consolelog}" ]; then
- echo -e "\nConsole log\n===================="
- if [ ! "$(ls -A "${consolelogdir}")" ]; then
- echo -e "${consolelogdir} (NO LOG FILES)"
- elif [ ! -s "${consolelog}" ]; then
- echo -e "${consolelog} (LOG FILE IS EMPTY)"
- else
- echo -e "${consolelog}"
- tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }'
- fi
- echo -e ""
- fi
- if [ -n "${gamelogdir}" ]; then
- echo -e "\nServer log\n==================="
- if [ ! "$(ls -A "${gamelogdir}")" ]; then
- echo -e "${gamelogdir} (NO LOG FILES)"
- else
- echo -e "${gamelogdir}"
- # dos2unix sed 's/\r//'
- tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25
- fi
- echo -e ""
- fi
- }
- # Engine/Game Specific details
- fn_info_message_assettocorsa(){
- echo -e "netstat -atunp| grep acServer"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> HTTP\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_ark(){
- echo -e "netstat -atunp | grep ShooterGame"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- # Don't do arithmetics if ever the port wasn't a numeric value
- if [ "${port}" -eq "${port}" ]; then
- echo -e "> RAW\tINBOUND\t$((port+1))\tudp"
- fi
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_avorion() {
- echo "netstat -atunp | grep Avorion"
- echo -e ""
- {
- echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_ballisticoverkill(){
- echo -e "netstat -atunp | grep BODS.x86"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_battalion1944(){
- echo -e "netstat -atunp | grep BattalionServ"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- # Don't do arithmetics if ever the port wasn't a numeric value
- # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding
- if [ "${port}" -eq "${port}" ]; then
- echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
- echo -e "> Unused\tINBOUND\t$((port+2))\ttcp"
- fi
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_cod(){
- echo -e "netstat -atunp | grep cod_lnxded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_coduo(){
- echo -e "netstat -atunp | grep coduo_lnxded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_chivalry(){
- fn_info_message_password_strip
- echo -e "netstat -atunp | grep UDKGame"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> RCON\tINBOUND\t27960\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_cod2(){
- echo -e "netstat -atunp | grep cod2_lnxded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_cod4(){
- echo -e "netstat -atunp"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_codwaw(){
- echo -e "netstat -atunp | grep codwaw_lnxded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_dst(){
- echo -e "netstat -atunp | grep dontstarve"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game: Server\tINBOUND\t${port}\tudp"
- echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
- echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
- echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_eco(){
- echo -e "netstat -atunp | grep EcoServer"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_etlegacy(){
- echo -e "netstat -atunp | grep etlded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_factorio(){
- echo -e "netstat -atunp | grep factorio"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_goldsrc(){
- echo -e "netstat -atunp | grep hlds_linux"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
- echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_hurtworld(){
- echo -e "netstat -atunp | grep Hurtworld"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_inss(){
- echo -e "netstat -atunp | grep Insurgency"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- if [ -n "${rconport}" ]; then
- echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
- fi
- } | column -s $'\t' -t
- }
- fn_info_message_jk2(){
- echo -e "netstat -atunp | grep jk2mvded"
- echo -e ""
- {
- echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_justcause2(){
- echo -e "netstat -atunp | grep Jcmp-Server"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_justcause3(){
- echo -e "netstat -atunp | grep Server"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> Steam\tINBOUND\t${steamport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_minecraft(){
- echo -e "netstat -atunp | grep java"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\ttcp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_minecraft_bedrock(){
- echo -e "netstat -atunp | grep bedrock_serv"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Game\tINBOUND\t${port6}\tudp6"
- } | column -s $'\t' -t
- }
- fn_info_message_onset(){
- echo -e "netstat -atunp | grep OnsetServer"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_mohaa(){
- echo -e "netstat -atunp | grep mohaa_lnxded"
- echo -e ""
- {
- echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_mom(){
- echo -e "netstat -atunp | grep MemoriesOfMar"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_mumble(){
- echo -e "netstat -atunp | grep murmur"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Voice\tINBOUND\t${port}\tudp"
- echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_pstbs(){
- echo -e "netstat -atunp | grep PostScriptum"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_projectcars(){
- echo -e "netstat -atunp | grep DedicatedS"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> Steam\tINBOUND\t${steamport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_projectzomboid(){
- echo -e "netstat -atunp | grep ProjectZomb"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_quake(){
- echo -e "netstat -atunp | grep mvdsv"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_quake2(){
- echo -e "netstat -atunp | grep quake2"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_quake3(){
- echo -e "netstat -atunp | grep q3ded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_quakelive(){
- echo -e "netstat -atunp | grep qzeroded"
- echo -e ""
- if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
- echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
- echo -e ""
- fi
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\tudp"
- echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
- echo -e "> Stats\tINBOUND\t${statsport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_arma3(){
- echo -e "netstat -atunp | grep arma3server"
- echo -e ""
- # Default port
- if [ -z "${port}" ]; then
- port="2302"
- fi
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- # Don't do arithmetics if ever the port wasn't a numeric value
- if [ "${port}" -eq "${port}" ]; then
- echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp"
- echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
- echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
- fi
- } | column -s $'\t' -t
- }
- fn_info_message_bf1942(){
- echo -e "netstat -atunp | grep bf1942_lnxd"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\tudp"
- echo -e "> Query Steam\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_bfv(){
- echo -e "netstat -atunp | grep bfv_linded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_risingworld(){
- echo -e "netstat -atunp | grep java"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
- echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp"
- echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_rtcw(){
- echo -e "netstat -atunp | grep iowolfded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_rust(){
- echo -e "netstat -atunp | grep Rust"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\tudp"
- echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_samp(){
- echo -e "netstat -atunp | grep samp03svr"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
- } | column -s $'\t' -t
- }
- fn_info_message_sbots(){
- echo -e "netstat -atunp | grep blank1"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_sdtd(){
- fn_info_message_password_strip
- echo -e "netstat -atunp | grep 7DaysToDie"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
- echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
- } | column -s $'\t' -t
- echo -e ""
- echo -e "${lightgreen}${gamename} Web Admin${default}"
- fn_messages_separator
- {
- echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
- echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
- echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
- } | column -s $'\t' -t
- echo -e ""
- echo -e "${lightgreen}${gamename} Telnet${default}"
- fn_messages_separator
- {
- echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
- echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}"
- echo -e "${lightblue}Telnet password:\t${default}${telnetpass}"
- } | column -s $'\t' -t
- }
- fn_info_message_sof2(){
- echo -e "netstat -atunp | grep sof2ded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_source(){
- echo -e "netstat -atunp | grep srcds_linux"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
- echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
- echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_spark(){
- fn_info_message_password_strip
- echo -e "netstat -atunp | grep server_linux"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
- } | column -s $'\t' -t
- echo -e ""
- echo -e "${lightgreen}${servername} Web Admin${default}"
- fn_messages_separator
- {
- echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html"
- echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
- echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
- } | column -s $'\t' -t
- }
- fn_info_message_squad(){
- echo -e "netstat -atunp | grep SquadServer"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_starbound(){
- echo -e "netstat -atunp | grep starbound"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- 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_info_message_stationeers(){
- echo -e "netstat -atunp | grep rocketstation"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\ttcp"
- echo -e "> Query\tINBOUND\t${queryport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_teamspeak3(){
- echo -e "netstat -atunp | grep ts3server"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- 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_info_message_teeworlds(){
- echo -e "netstat -atunp | grep teeworlds"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\Query\tINBOUND\t${port}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_terraria(){
- echo -e "netstat -atunp | grep Terraria"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_towerunite(){
- echo -e "netstat -atunp | grep TowerServer"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\ttcp"
- # Don't do arithmetics if ever the port wasn't a numeric value
- if [ "${port}" -eq "${port}" ]; then
- echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
- fi
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_unreal(){
- fn_info_message_password_strip
- echo -e "netstat -atunp | grep ucc-bin"
- 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"
- if [ "${engine}" == "unreal" ]; then
- echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
- fi
- if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then
- echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
- fi
- if [ "${appid}" == "215360" ]; then
- echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
- else
- echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
- fi
- if [ "${appid}" ]; then
- if [ "${appid}" == "223250" ]; then
- echo -e "> Steam\tINBOUND\t20610\tudp"
- else
- echo -e "> Steam\tINBOUND\t20660\tudp"
- fi
- fi
- echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
- } | column -s $'\t' -t
- echo -e ""
- echo -e "${lightgreen}${servername} Web Admin${default}"
- fn_messages_separator
- {
- echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
- echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
- echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
- echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
- } | column -s $'\t' -t
- }
- fn_info_message_unreal2(){
- fn_info_message_password_strip
- echo -e "netstat -atunp | grep ucc-bin"
- 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"
- if [ "${appid}" != "223250" ]; then
- echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
- fi
- echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
- } | column -s $'\t' -t
- echo -e ""
- echo -e "${lightgreen}${servername} Web Admin${default}"
- fn_messages_separator
- {
- echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
- echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
- echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
- echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
- } | column -s $'\t' -t
- }
- fn_info_message_unreal3(){
- fn_info_message_password_strip
- echo -e "netstat -atunp | grep ut3-bin"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
- } | column -s $'\t' -t
- echo -e ""
- echo -e "${lightgreen}${servername} Web Admin${default}"
- fn_messages_separator
- {
- echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
- echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
- echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
- echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
- } | column -s $'\t' -t
- }
- fn_info_message_unturned(){
- echo -e "netstat -atunp | grep Unturned"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_ut(){
- echo -e "netstat -atunp | grep UE4Server"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_vh(){
- echo -e "netstat -atunp | grep valheim"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_kf2(){
- fn_info_message_password_strip
- echo -e "netstat -atunp | grep KFGame"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> Steam\tINBOUND\t20560\tudp"
- echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
- } | column -s $'\t' -t
- echo -e ""
- echo -e "${lightgreen}${servername} Web Admin${default}"
- fn_messages_separator
- {
- echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
- echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
- echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
- echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
- } | column -s $'\t' -t
- }
- fn_info_message_wolfensteinenemyterritory(){
- echo -e "netstat -atunp | grep etded"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_wurmunlimited(){
- echo -e "netstat -atunp | grep WurmServer"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\ttcp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_mta(){
- echo -e "netstat -atunp | grep mta-server"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game/Query\tINBOUND\t${port}\tudp"
- echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
- if [ "${ase}" == "Enabled" ]; then
- echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp"
- fi
- } | column -s $'\t' -t
- }
- fn_info_message_mordhau(){
- echo -e "netstat -atunp | grep Mord"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_barotrauma(){
- echo -e "netstat -atunp | grep /./Server.bin"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t$((port+1))\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_soldat() {
- echo -e "netstat -atunp | grep soldat"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Query\tINBOUND\t${queryport}\tudp"
- echo -e "> FILES\tINBOUND\t$((port+10))\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_warfork(){
- echo -e "netstat -atunp | grep wf_server"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
- } | column -s $'\t' -t
- }
- fn_info_message_pavlovvr(){
- echo "netstat -atunp | grep Pavlov"
- echo -e ""
- {
- echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Game\tINBOUND\t$((port+400))\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_colony(){
- echo -e "netstat -atunp | grep colonyserv"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- echo -e "> Steam\tINBOUND\t${steamport}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_vintagestory(){
- echo "netstat -atunp | grep cli"
- echo -e ""
- {
- echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
- echo -e "> Game\tINBOUND\t${port}\tTCP"
- } | column -s $'\t' -t
- }
- fn_info_message_scpsl(){
- echo -e "netstat -atunp | grep SCPSL"
- echo -e ""
- {
- echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
- echo -e "> Game\tINBOUND\t${port}\tudp"
- } | column -s $'\t' -t
- }
- fn_info_message_select_engine(){
- # Display details depending on game or engine.
- if [ "${shortname}" == "ac" ]; then
- fn_info_message_assettocorsa
- elif [ "${shortname}" == "ark" ]; then
- fn_info_message_ark
- elif [ "${shortname}" == "av" ]; then
- fn_info_message_avorion
- elif [ "${shortname}" == "arma3" ]; then
- fn_info_message_arma3
- elif [ "${shortname}" == "bf1942" ]; then
- fn_info_message_bf1942
- elif [ "${shortname}" == "bfv" ]; then
- fn_info_message_bfv
- elif [ "${shortname}" == "bo" ]; then
- fn_info_message_ballisticoverkill
- elif [ "${shortname}" == "bt" ]; then
- fn_info_message_barotrauma
- elif [ "${shortname}" == "bt1944" ]; then
- fn_info_message_battalion1944
- elif [ "${shortname}" == "cmw" ]; then
- fn_info_message_chivalry
- elif [ "${shortname}" == "cod" ]; then
- fn_info_message_cod
- elif [ "${shortname}" == "coduo" ]; then
- fn_info_message_coduo
- elif [ "${shortname}" == "cod2" ]; then
- fn_info_message_cod2
- elif [ "${shortname}" == "cod4" ]; then
- fn_info_message_cod4
- elif [ "${shortname}" == "codwaw" ]; then
- fn_info_message_codwaw
- elif [ "${shortname}" == "col" ]; then
- fn_info_message_colony
- elif [ "${shortname}" == "dst" ]; then
- fn_info_message_dst
- elif [ "${shortname}" == "eco" ]; then
- fn_info_message_eco
- elif [ "${shortname}" == "etl" ]; then
- fn_info_message_etlegacy
- elif [ "${shortname}" == "fctr" ]; then
- fn_info_message_factorio
- elif [ "${shortname}" == "hw" ]; then
- fn_info_message_hurtworld
- elif [ "${shortname}" == "inss" ]; then
- fn_info_message_inss
- elif [ "${shortname}" == "jk2" ]; then
- fn_info_message_jk2
- elif [ "${shortname}" == "jc2" ]; then
- fn_info_message_justcause2
- elif [ "${shortname}" == "jc3" ]; then
- fn_info_message_justcause3
- elif [ "${shortname}" == "kf2" ]; then
- fn_info_message_kf2
- elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then
- fn_info_message_minecraft
- elif [ "${shortname}" == "mcb" ]; then
- fn_info_message_minecraft_bedrock
- elif [ "${shortname}" == "mh" ]; then
- fn_info_message_mordhau
- elif [ "${shortname}" == "mohaa" ]; then
- fn_info_message_mohaa
- elif [ "${shortname}" == "mta" ]; then
- fn_info_message_mta
- elif [ "${shortname}" == "mumble" ]; then
- fn_info_message_mumble
- elif [ "${shortname}" == "onset" ]; then
- fn_info_message_onset
- elif [ "${shortname}" == "mom" ]; then
- fn_info_message_mom
- elif [ "${shortname}" == "pz" ]; then
- fn_info_message_projectzomboid
- elif [ "${shortname}" == "pstbs" ]; then
- fn_info_message_pstbs
- elif [ "${shortname}" == "pc" ]; then
- fn_info_message_projectcars
- elif [ "${shortname}" == "qw" ]; then
- fn_info_message_quake
- elif [ "${shortname}" == "q2" ]; then
- fn_info_message_quake2
- elif [ "${shortname}" == "q3" ]; then
- fn_info_message_quake3
- elif [ "${shortname}" == "ql" ]; then
- fn_info_message_quakelive
- elif [ "${shortname}" == "samp" ]; then
- fn_info_message_samp
- elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
- fn_info_message_scpsl
- elif [ "${shortname}" == "sdtd" ]; then
- fn_info_message_sdtd
- elif [ "${shortname}" == "squad" ]; then
- fn_info_message_squad
- elif [ "${shortname}" == "st" ]; then
- fn_info_message_stationeers
- elif [ "${shortname}" == "sof2" ]; then
- fn_info_message_sof2
- elif [ "${shortname}" == "sol" ]; then
- fn_info_message_soldat
- elif [ "${shortname}" == "sb" ]; then
- fn_info_message_starbound
- elif [ "${shortname}" == "sbots" ]; then
- fn_info_message_sbots
- elif [ "${shortname}" == "terraria" ]; then
- fn_info_message_terraria
- elif [ "${shortname}" == "ts3" ]; then
- fn_info_message_teamspeak3
- elif [ "${shortname}" == "tu" ]; then
- fn_info_message_towerunite
- elif [ "${shortname}" == "tw" ]; then
- fn_info_message_teeworlds
- elif [ "${shortname}" == "unt" ]; then
- fn_info_message_unturned
- elif [ "${shortname}" == "ut" ]; then
- fn_info_message_ut
- elif [ "${shortname}" == "vh" ]; then
- fn_info_message_vh
- elif [ "${shortname}" == "rtcw" ]; then
- fn_info_message_rtcw
- elif [ "${shortname}" == "pvr" ]; then
- fn_info_message_pavlovvr
- elif [ "${shortname}" == "rust" ]; then
- fn_info_message_rust
- elif [ "${shortname}" == "vints" ]; then
- fn_info_message_vintagestory
- elif [ "${shortname}" == "wf" ]; then
- fn_info_message_warfork
- elif [ "${shortname}" == "wurm" ]; then
- fn_info_message_wurmunlimited
- elif [ "${shortname}" == "rw" ]; then
- fn_info_message_risingworld
- elif [ "${shortname}" == "wet" ]; then
- fn_info_message_wolfensteinenemyterritory
- elif [ "${engine}" == "goldsrc" ]; then
- fn_info_message_goldsrc
- elif [ "${engine}" == "source" ]; then
- fn_info_message_source
- elif [ "${engine}" == "spark" ]; then
- fn_info_message_spark
- elif [ "${engine}" == "unreal" ]; then
- fn_info_message_unreal
- elif [ "${engine}" == "unreal2" ]; then
- fn_info_message_unreal2
- elif [ "${engine}" == "unreal3" ]; then
- fn_info_message_unreal3
- else
- fn_print_error_nl "Unable to detect server engine."
- fi
- }
|