info_messages.sh 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634
  1. #!/bin/bash
  2. # LinuxGSM info_messages.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Defines server info messages for details and alerts.
  6. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  7. # Standard Details
  8. # This applies to all engines
  9. fn_info_message_head(){
  10. echo -e ""
  11. echo -e "${lightyellow}Summary${default}"
  12. fn_messages_separator
  13. echo -e "Message"
  14. echo -e "${alertbody}"
  15. echo -e ""
  16. echo -e "Game"
  17. echo -e "${gamename}"
  18. echo -e ""
  19. echo -e "Server name"
  20. echo -e "${servername}"
  21. echo -e ""
  22. echo -e "Hostname"
  23. echo -e "${HOSTNAME}"
  24. echo -e ""
  25. echo -e "Server IP"
  26. if [ "${multiple_ip}" == "1" ]; then
  27. echo -e "NOT SET"
  28. else
  29. echo -e "${ip}:${port}"
  30. fi
  31. }
  32. fn_info_message_distro(){
  33. #
  34. # Distro Details
  35. # =====================================
  36. # Distro: Ubuntu 14.04.4 LTS
  37. # Arch: x86_64
  38. # Kernel: 3.13.0-79-generic
  39. # Hostname: hostname
  40. # tmux: tmux 1.8
  41. # glibc: 2.19
  42. echo -e ""
  43. echo -e "${lightyellow}Distro Details${default}"
  44. fn_messages_separator
  45. {
  46. echo -e "${lightblue}Distro:\t${default}${distroname}"
  47. echo -e "${lightblue}Arch:\t${default}${arch}"
  48. echo -e "${lightblue}Kernel:\t${default}${kernel}"
  49. echo -e "${lightblue}Hostname:\t${default}${HOSTNAME}"
  50. echo -e "${lightblue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m"
  51. echo -e "${lightblue}tmux:\t${default}${tmuxv}"
  52. echo -e "${lightblue}glibc:\t${default}${glibcversion}"
  53. } | column -s $'\t' -t
  54. }
  55. fn_info_message_server_resource(){
  56. #
  57. # Server Resource
  58. # ==========================================================================================================================================================================================================================================
  59. # CPU
  60. # Model: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
  61. # Cores: 4
  62. # Frequency: 2499.994 MHz
  63. # Avg Load: 0.20, 0.08, 0.01
  64. #
  65. # Memory
  66. # Mem: total used free cached available
  67. # Physical: 7.8GB 598MB 7.0GB 4.0GB 7.0GB
  68. # Swap: 512MB 0B 512MB
  69. #
  70. # Storage
  71. # Filesystem: /dev/sda
  72. # Total: 157G
  73. # Used: 138G
  74. # Available: 12G
  75. echo -e ""
  76. echo -e "${lightyellow}Server Resource${default}"
  77. fn_messages_separator
  78. {
  79. echo -e "${lightyellow}CPU\t${default}"
  80. echo -e "${lightblue}Model:\t${default}${cpumodel}"
  81. echo -e "${lightblue}Cores:\t${default}${cpucores}"
  82. echo -e "${lightblue}Frequency:\t${default}${cpufreqency}MHz"
  83. echo -e "${lightblue}Avg Load:\t${default}${load}"
  84. } | column -s $'\t' -t
  85. echo -e ""
  86. {
  87. echo -e "${lightyellow}Memory\t${default}"
  88. echo -e "${lightblue}Mem:\t${lightblue}total\tused\tfree\tcached\tavailable${default}"
  89. echo -e "${lightblue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}"
  90. echo -e "${lightblue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
  91. } | column -s $'\t' -t
  92. echo -e ""
  93. {
  94. echo -e "${lightyellow}Storage${default}"
  95. echo -e "${lightblue}Filesystem:\t${default}${filesystem}"
  96. echo -e "${lightblue}Total:\t\t${default}${totalspace}"
  97. echo -e "${lightblue}Used:\t\t${default}${usedspace}"
  98. echo -e "${lightblue}Available:\t${default}${availspace}"
  99. } | column -s $'\t' -t
  100. echo -e ""
  101. {
  102. echo -e "${lightyellow}Network${default}"
  103. if [ -n "${netint}" ]; then
  104. echo -e "${lightblue}Interface:\t${default}${netint}"
  105. fi
  106. if [ -n "${netlink}" ]; then
  107. echo -e "${lightblue}Link Speed:\t${default}${netlink}"
  108. fi
  109. echo -e "${lightblue}IP:\t${default}${ip}"
  110. if [ "${ip}" != "${extip}" ]; then
  111. echo -e "${lightblue}Internet IP:\t${default}${extip}"
  112. fi
  113. } | column -s $'\t' -t
  114. }
  115. fn_info_message_gameserver_resource(){
  116. # Game Server Resource Usage
  117. # ==========================================================================================================================================================================================================================================
  118. # CPU Used: 2.5%
  119. # Mem Used: 2.1% 171MB
  120. #
  121. # Storage
  122. # Total: 21G
  123. # Serverfiles: 20G
  124. # Backups: 20K
  125. echo -e ""
  126. echo -e "${lightyellow}Game Server Resource Usage${default}"
  127. fn_messages_separator
  128. {
  129. if [ "${status}" != "0" ]; then
  130. echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}"
  131. echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}MB${default}"
  132. else
  133. echo -e "${lightblue}CPU Used:\t${default}0%${default}"
  134. echo -e "${lightblue}Mem Used:\t${default}0%\t0MB${default}"
  135. fi
  136. } | column -s $'\t' -t
  137. echo -e ""
  138. {
  139. echo -e "${lightyellow}Storage${default}"
  140. echo -e "${lightblue}Total:\t${default}${rootdirdu}"
  141. echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}"
  142. if [ -d "${backupdir}" ]; then
  143. echo -e "${lightblue}Backups:\t${default}${backupdirdu}"
  144. fi
  145. } | column -s $'\t' -t
  146. }
  147. fn_info_message_gameserver(){
  148. # Counter-Strike: Global Offensive Server Details
  149. # ==========================================================================================================================================================================================================================================
  150. # Server name: LinuxGSM
  151. # Server IP: 80.70.189.230:27015
  152. # Server password: NOT SET
  153. # RCON password: adminF54CC0VR
  154. # Players: 0/16
  155. # Current map: de_mirage
  156. # Default map: de_mirage
  157. # Game type: 0
  158. # Game mode: 0
  159. # Tick rate: 64
  160. # Master Server: listed
  161. # Status: ONLINE
  162. echo -e ""
  163. echo -e "${lightgreen}${gamename} Server Details${default}"
  164. fn_info_message_password_strip
  165. fn_messages_separator
  166. {
  167. # Server name
  168. if [ -n "${gdname}" ]; then
  169. echo -e "${lightblue}Server name:\t${default}${gdname}"
  170. elif [ -n "${servername}" ]; then
  171. echo -e "${lightblue}Server name:\t${default}${servername}"
  172. fi
  173. # Server description
  174. if [ -n "${serverdescription}" ]; then
  175. echo -e "${lightblue}Server Description:\t${default}${serverdescription}"
  176. fi
  177. # Appid
  178. if [ -n "${appid}" ]; then
  179. echo -e "${lightblue}App ID:\t${default}${appid}"
  180. fi
  181. # Branch
  182. if [ -n "${branch}" ]; then
  183. echo -e "${lightblue}Branch:\t${default}${branch}"
  184. fi
  185. # Beta Password
  186. if [ -n "${betapassword}" ]; then
  187. echo -e "${lightblue}Beta Password:\t${default}${betapassword}"
  188. fi
  189. # Server ip
  190. if [ "${multiple_ip}" == "1" ]; then
  191. echo -e "${lightblue}Server IP:\t${default}NOT SET"
  192. else
  193. echo -e "${lightblue}Server IP:\t${default}${ip}:${port}"
  194. fi
  195. # Internet ip
  196. if [ -n "${extip}" ]; then
  197. if [ "${ip}" != "${extip}" ]; then
  198. echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}"
  199. fi
  200. fi
  201. # Display ip
  202. if [ -n "${displayip}" ]; then
  203. echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}"
  204. fi
  205. # Server password
  206. if [ -n "${serverpassword}" ]; then
  207. echo -e "${lightblue}Server password:\t${default}${serverpassword}"
  208. fi
  209. # Query enabled (Starbound)
  210. if [ -n "${queryenabled}" ]; then
  211. echo -e "${lightblue}Query enabled:\t${default}${queryenabled}"
  212. fi
  213. # RCON enabled (Starbound)
  214. if [ -n "${rconenabled}" ]; then
  215. echo -e "${lightblue}RCON enabled:\t${default}${rconenabled}"
  216. fi
  217. # RCON password
  218. if [ -n "${rconpassword}" ]; then
  219. echo -e "${lightblue}RCON password:\t${default}${rconpassword}"
  220. fi
  221. # RCON web (Rust)
  222. if [ -n "${rconweb}" ]; then
  223. echo -e "${lightblue}RCON web:\t${default}${rconweb}"
  224. fi
  225. # Admin password
  226. if [ -n "${adminpassword}" ]; then
  227. echo -e "${lightblue}Admin password:\t${default}${adminpassword}"
  228. fi
  229. # Stats password (Quake Live)
  230. if [ -n "${statspassword}" ]; then
  231. echo -e "${lightblue}Stats password:\t${default}${statspassword}"
  232. fi
  233. # Players
  234. if [ "${querystatus}" != "0" ]; then
  235. if [ -n "${maxplayers}" ]; then
  236. echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}"
  237. fi
  238. else
  239. if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
  240. echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}"
  241. elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then
  242. echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}"
  243. elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
  244. echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}"
  245. elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then
  246. echo -e "${lightblue}Players:\t${default}${gdplayers}/∞"
  247. elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then
  248. echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}"
  249. fi
  250. fi
  251. # Bots
  252. if [ -n "${gdbots}" ]; then
  253. echo -e "${lightblue}Bots:\t${default}${gdbots}"
  254. fi
  255. # Current map
  256. if [ -n "${gdmap}" ]; then
  257. echo -e "${lightblue}Current map:\t${default}${gdmap}"
  258. fi
  259. # Default map
  260. if [ -n "${defaultmap}" ]; then
  261. echo -e "${lightblue}Default map:\t${default}${defaultmap}"
  262. fi
  263. if [ -n "${defaultscenario}" ]; then
  264. # Current scenario
  265. if [ -n "${gdgamemode}" ]; then
  266. echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}"
  267. fi
  268. else
  269. # Current game mode
  270. if [ -n "${gdgamemode}" ]; then
  271. echo -e "${lightblue}Current game mode:\t${default}${gdgamemode}"
  272. fi
  273. fi
  274. # Default scenario
  275. if [ -n "${defaultscenario}" ]; then
  276. echo -e "${lightblue}Default scenario:\t${default}${defaultscenario}"
  277. fi
  278. # Game type
  279. if [ -n "${gametype}" ]; then
  280. echo -e "${lightblue}Game type:\t${default}${gametype}"
  281. fi
  282. # Game mode
  283. if [ -n "${gamemode}" ]; then
  284. echo -e "${lightblue}Game mode:\t${default}${gamemode}"
  285. fi
  286. # Game world
  287. if [ -n "${gameworld}" ]; then
  288. echo -e "${lightblue}Game world:\t${default}${gameworld}"
  289. fi
  290. # Tick rate
  291. if [ -n "${tickrate}" ]; then
  292. echo -e "${lightblue}Tick rate:\t${default}${tickrate}"
  293. fi
  294. # Sharding (Don't Starve Together)
  295. if [ -n "${sharding}" ]; then
  296. echo -e "${lightblue}Sharding:\t${default}${sharding}"
  297. fi
  298. # Master (Don't Starve Together)
  299. if [ -n "${master}" ]; then
  300. echo -e "${lightblue}Master:\t${default}${master}"
  301. fi
  302. # Shard (Don't Starve Together)
  303. if [ -n "${shard}" ]; then
  304. echo -e "${lightblue}Shard:\t${default}${shard}"
  305. fi
  306. # Cluster (Don't Starve Together)
  307. if [ -n "${cluster}" ]; then
  308. echo -e "${lightblue}Cluster:\t${default}${cluster}"
  309. fi
  310. # Cave (Don't Starve Together)
  311. if [ -n "${cave}" ]; then
  312. echo -e "${lightblue}Cave:\t${default}${cave}"
  313. fi
  314. # Creativemode (Hurtworld)
  315. if [ -n "${creativemode}" ]; then
  316. echo -e "${lightblue}Creativemode:\t${default}${creativemode}"
  317. fi
  318. # TeamSpeak dbplugin
  319. if [ -n "${dbplugin}" ]; then
  320. echo -e "${lightblue}dbplugin:\t${default}${dbplugin}"
  321. fi
  322. # ASE (Multi Theft Auto)
  323. if [ -n "${ase}" ]; then
  324. echo -e "${lightblue}ASE:\t${default}${ase}"
  325. fi
  326. # Save interval (Rust)
  327. if [ -n "${saveinterval}" ]; then
  328. echo -e "${lightblue}ASE:\t${default}${saveinterval} s"
  329. fi
  330. # Random map rotation mode (Squad and Post Scriptum)
  331. if [ -n "${randommap}" ]; then
  332. echo -e "${lightblue}Map rotation:\t${default}${randommap}"
  333. fi
  334. # Server Version (Jedi Knight II: Jedi Outcast)
  335. if [ -n "${serverversion}" ]; then
  336. echo -e "${lightblue}Server Version:\t${default}${serverversion}"
  337. fi
  338. # authentication token (Factorio)
  339. if [ -n "${authtoken}" ]; then
  340. echo -e "${lightblue}Auth Token:\t${default}${authtoken}"
  341. fi
  342. # savegameinterval (Factorio)
  343. if [ -n "${savegameinterval}" ]; then
  344. echo -e "${lightblue}Savegame Interval:\t${default}${savegameinterval}"
  345. fi
  346. # versioncount (Factorio)
  347. if [ -n "${versioncount}" ]; then
  348. echo -e "${lightblue}Version Count:\t${default}${versioncount}"
  349. fi
  350. # Listed on Master server
  351. if [ -n "${displaymasterserver}" ]; then
  352. if [ "${displaymasterserver}" == "true" ]; then
  353. echo -e "${lightblue}Master server:\t${green}listed${default}"
  354. else
  355. echo -e "${lightblue}Master server:\t${red}not listed${default}"
  356. fi
  357. fi
  358. # Online status
  359. if [ "${status}" == "0" ]; then
  360. echo -e "${lightblue}Status:\t${red}OFFLINE${default}"
  361. else
  362. echo -e "${lightblue}Status:\t${green}ONLINE${default}"
  363. fi
  364. } | column -s $'\t' -t
  365. echo -e ""
  366. }
  367. fn_info_message_script(){
  368. #
  369. # csgoserver Script Details
  370. #==========================================================================================================================================================================================================================================
  371. # Script name: csgoserver
  372. # LinuxGSM version: v19.9.0
  373. # glibc required: 2.15
  374. # Discord alert: off
  375. # Email alert: off
  376. # IFTTT alert: off
  377. # Mailgun (email) alert: off
  378. # Pushbullet alert: off
  379. # Pushover alert: off
  380. # Rocketchat alert: off
  381. # Slack alert: off
  382. # Telegram alert: off
  383. # Update on start: off
  384. # User: lgsm
  385. # Location: /home/lgsm/csgoserver
  386. # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg
  387. echo -e "${lightgreen}${selfname} Script Details${default}"
  388. fn_messages_separator
  389. {
  390. # Script name
  391. echo -e "${lightblue}Script name:\t${default}${selfname}"
  392. # LinuxGSM version
  393. if [ -n "${version}" ]; then
  394. echo -e "${lightblue}LinuxGSM version:\t${default}${version}"
  395. fi
  396. # glibc required
  397. if [ -n "${glibc}" ]; then
  398. if [ "${glibc}" == "null" ]; then
  399. # Glibc is not required.
  400. :
  401. elif [ -z "${glibc}" ]; then
  402. echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}"
  403. elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then
  404. echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})"
  405. else
  406. echo -e "${lightblue}glibc required:\t${green}${glibc}${default}"
  407. fi
  408. fi
  409. # Discord alert
  410. echo -e "${lightblue}Discord alert:\t${default}${discordalert}"
  411. # Email alert
  412. echo -e "${lightblue}Email alert:\t${default}${emailalert}"
  413. # IFTTT alert
  414. echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}"
  415. # Mailgun alert
  416. echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}"
  417. # Pushbullet alert
  418. echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"
  419. # Pushover alert
  420. echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}"
  421. # Rocketchat alert
  422. echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}"
  423. # Slack alert
  424. echo -e "${lightblue}Slack alert:\t${default}${slackalert}"
  425. # Telegram alert
  426. echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}"
  427. # Update on start
  428. if [ -n "${updateonstart}" ]; then
  429. echo -e "${lightblue}Update on start:\t${default}${updateonstart}"
  430. fi
  431. # User
  432. echo -e "${lightblue}User:\t${default}$(whoami)"
  433. # Script location
  434. echo -e "${lightblue}Location:\t${default}${rootdir}"
  435. # Config file location
  436. if [ -n "${servercfgfullpath}" ]; then
  437. if [ -f "${servercfgfullpath}" ]; then
  438. echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}"
  439. elif [ -d "${servercfgfullpath}" ]; then
  440. echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}"
  441. else
  442. echo -e "${lightblue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
  443. fi
  444. fi
  445. # Network config file location (ARMA 3)
  446. if [ -n "${networkcfgfullpath}" ]; then
  447. echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}"
  448. fi
  449. } | column -s $'\t' -t
  450. }
  451. fn_info_message_backup(){
  452. #
  453. # Backups
  454. # =====================================
  455. # No. of backups: 1
  456. # Latest backup:
  457. # date: Fri May 6 18:34:19 UTC 2016
  458. # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
  459. # size: 945M
  460. echo -e ""
  461. echo -e "${lightgreen}Backups${default}"
  462. fn_messages_separator
  463. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  464. echo -e "No Backups created"
  465. else
  466. {
  467. echo -e "${lightblue}No. of backups:\t${default}${backupcount}"
  468. echo -e "${lightblue}Latest backup:${default}"
  469. if [ "${lastbackupdaysago}" == "0" ]; then
  470. echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)"
  471. elif [ "${lastbackupdaysago}" == "1" ]; then
  472. echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)"
  473. else
  474. echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)"
  475. fi
  476. echo -e "${lightblue} file:\t${default}${lastbackup}"
  477. echo -e "${lightblue} size:\t${default}${lastbackupsize}"
  478. } | column -s $'\t' -t
  479. fi
  480. }
  481. fn_info_message_commandlineparms(){
  482. #
  483. # Command-line Parameters
  484. # =====================================
  485. # ./run_server_x86.sh +set net_strict 1
  486. echo -e ""
  487. echo -e "${lightgreen}Command-line Parameters${default}"
  488. fn_info_message_password_strip
  489. fn_messages_separator
  490. if [ "${serverpassword}" == "NOT SET" ]; then
  491. unset serverpassword
  492. fi
  493. fn_parms
  494. echo -e "${executable} ${parms}"
  495. }
  496. fn_info_message_ports(){
  497. # Ports
  498. # =====================================
  499. # Change ports by editing the parameters in:
  500. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  501. echo -e ""
  502. echo -e "${lightgreen}Ports${default}"
  503. fn_messages_separator
  504. echo -e "${lightblue}Change ports by editing the parameters in:${default}"
  505. parmslocation="${red}UNKNOWN${default}"
  506. # engines/games that require editing in the config file.
  507. 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" "wurm")
  508. for port_edit in "${ports_edit_array[@]}"; do
  509. if [ "${shortname}" == "ut3" ]; then
  510. parmslocation="${servercfgdir}/UTWeb.ini"
  511. elif [ "${shortname}" == "kf2" ]; then
  512. parmslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini"
  513. elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  514. parmslocation="${servercfgfullpath}"
  515. fi
  516. done
  517. # engines/games that require editing the parms.
  518. local ports_edit_array=( "Avorion" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" )
  519. for port_edit in "${ports_edit_array[@]}"; do
  520. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
  521. parmslocation="${configdirserver}"
  522. fi
  523. done
  524. echo -e "${parmslocation}"
  525. echo -e ""
  526. echo -e "${lightblue}Useful port diagnostic command:${default}"
  527. }
  528. fn_info_message_statusbottom(){
  529. echo -e ""
  530. if [ "${status}" == "0" ]; then
  531. echo -e "${lightblue}Status:\t${red}OFFLINE${default}"
  532. else
  533. echo -e "${lightblue}Status:\t${green}ONLINE${default}"
  534. fi
  535. echo -e ""
  536. }
  537. fn_info_logs(){
  538. echo -e ""
  539. echo -e "${selfname} Logs"
  540. echo -e "================================="
  541. if [ -n "${lgsmlog}" ]; then
  542. echo -e "\nScript log\n==================="
  543. if [ ! "$(ls -A "${lgsmlogdir}")" ]; then
  544. echo -e "${lgsmlogdir} (NO LOG FILES)"
  545. elif [ ! -s "${lgsmlog}" ]; then
  546. echo -e "${lgsmlog} (LOG FILE IS EMPTY)"
  547. else
  548. echo -e "${lgsmlog}"
  549. tail -25 "${lgsmlog}"
  550. fi
  551. echo -e ""
  552. fi
  553. if [ -n "${consolelog}" ]; then
  554. echo -e "\nConsole log\n===================="
  555. if [ ! "$(ls -A "${consolelogdir}")" ]; then
  556. echo -e "${consolelogdir} (NO LOG FILES)"
  557. elif [ ! -s "${consolelog}" ]; then
  558. echo -e "${consolelog} (LOG FILE IS EMPTY)"
  559. else
  560. echo -e "${consolelog}"
  561. tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }'
  562. fi
  563. echo -e ""
  564. fi
  565. if [ -n "${gamelogdir}" ]; then
  566. echo -e "\nServer log\n==================="
  567. if [ ! "$(ls -A "${gamelogdir}")" ]; then
  568. echo -e "${gamelogdir} (NO LOG FILES)"
  569. else
  570. echo -e "${gamelogdir}"
  571. # dos2unix sed 's/\r//'
  572. tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25
  573. fi
  574. echo -e ""
  575. fi
  576. }
  577. # Engine/Game Specific details
  578. fn_info_message_assettocorsa(){
  579. echo -e "netstat -atunp| grep acServer"
  580. echo -e ""
  581. {
  582. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  583. echo -e "> Game\tINBOUND\t${port}\tudp"
  584. echo -e "> HTTP\tINBOUND\t${port}\tudp"
  585. } | column -s $'\t' -t
  586. }
  587. fn_info_message_ark(){
  588. echo -e "netstat -atunp | grep ShooterGame"
  589. echo -e ""
  590. {
  591. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  592. echo -e "> Game\tINBOUND\t${port}\tudp"
  593. # Don't do arithmetics if ever the port wasn't a numeric value
  594. if [ "${port}" -eq "${port}" ]; then
  595. echo -e "> RAW\tINBOUND\t$((port+1))\tudp"
  596. fi
  597. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  598. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  599. } | column -s $'\t' -t
  600. }
  601. fn_info_message_avorion() {
  602. echo "netstat -atunp | grep Avorion"
  603. echo -e ""
  604. {
  605. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  606. echo -e "> Game\tINBOUND\t${port}\tudp"
  607. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  608. } | column -s $'\t' -t
  609. }
  610. fn_info_message_ballisticoverkill(){
  611. echo -e "netstat -atunp | grep BODS.x86"
  612. echo -e ""
  613. {
  614. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  615. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  616. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  617. } | column -s $'\t' -t
  618. }
  619. fn_info_message_battalion1944(){
  620. echo -e "netstat -atunp | grep BattalionServ"
  621. echo -e ""
  622. {
  623. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  624. echo -e "> Game\tINBOUND\t${port}\tudp"
  625. # Don't do arithmetics if ever the port wasn't a numeric value
  626. # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding
  627. if [ "${port}" -eq "${port}" ]; then
  628. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  629. echo -e "> Unused\tINBOUND\t$((port+2))\ttcp"
  630. fi
  631. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  632. } | column -s $'\t' -t
  633. }
  634. fn_info_message_cod(){
  635. echo -e "netstat -atunp | grep cod_lnxded"
  636. echo -e ""
  637. {
  638. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  639. echo -e "> Game\tINBOUND\t${port}\tudp"
  640. } | column -s $'\t' -t
  641. }
  642. fn_info_message_coduo(){
  643. echo -e "netstat -atunp | grep coduo_lnxded"
  644. echo -e ""
  645. {
  646. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  647. echo -e "> Game\tINBOUND\t${port}\tudp"
  648. } | column -s $'\t' -t
  649. }
  650. fn_info_message_chivalry(){
  651. fn_info_message_password_strip
  652. echo -e "netstat -atunp | grep UDKGame"
  653. echo -e ""
  654. {
  655. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  656. echo -e "> Game\tINBOUND\t${port}\tudp"
  657. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  658. echo -e "> RCON\tINBOUND\t27960\ttcp"
  659. } | column -s $'\t' -t
  660. }
  661. fn_info_message_cod2(){
  662. echo -e "netstat -atunp | grep cod2_lnxded"
  663. echo -e ""
  664. {
  665. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  666. echo -e "> Game\tINBOUND\t${port}\tudp"
  667. } | column -s $'\t' -t
  668. }
  669. fn_info_message_cod4(){
  670. echo -e "netstat -atunp"
  671. echo -e ""
  672. {
  673. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  674. echo -e "> Game\tINBOUND\t${port}\tudp"
  675. } | column -s $'\t' -t
  676. }
  677. fn_info_message_codwaw(){
  678. echo -e "netstat -atunp | grep codwaw_lnxded"
  679. echo -e ""
  680. {
  681. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  682. echo -e "> Game\tINBOUND\t${port}\tudp"
  683. } | column -s $'\t' -t
  684. }
  685. fn_info_message_dst(){
  686. echo -e "netstat -atunp | grep dontstarve"
  687. echo -e ""
  688. {
  689. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  690. echo -e "> Game: Server\tINBOUND\t${port}\tudp"
  691. echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
  692. echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
  693. echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
  694. } | column -s $'\t' -t
  695. }
  696. fn_info_message_eco(){
  697. echo -e "netstat -atunp | grep EcoServer"
  698. echo -e ""
  699. {
  700. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  701. echo -e "> Game\tINBOUND\t${port}\tudp"
  702. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  703. } | column -s $'\t' -t
  704. }
  705. fn_info_message_etlegacy(){
  706. echo -e "netstat -atunp | grep etlded"
  707. echo -e ""
  708. {
  709. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  710. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  711. } | column -s $'\t' -t
  712. }
  713. fn_info_message_factorio(){
  714. echo -e "netstat -atunp | grep factorio"
  715. echo -e ""
  716. {
  717. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  718. echo -e "> Game\tINBOUND\t${port}\tudp"
  719. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  720. } | column -s $'\t' -t
  721. }
  722. fn_info_message_goldsrc(){
  723. echo -e "netstat -atunp | grep hlds_linux"
  724. echo -e ""
  725. {
  726. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  727. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  728. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  729. } | column -s $'\t' -t
  730. }
  731. fn_info_message_hurtworld(){
  732. echo -e "netstat -atunp | grep Hurtworld"
  733. echo -e ""
  734. {
  735. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  736. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  737. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  738. } | column -s $'\t' -t
  739. }
  740. fn_info_message_inss(){
  741. echo -e "netstat -atunp | grep Insurgency"
  742. echo -e ""
  743. {
  744. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  745. echo -e "> Game\tINBOUND\t${port}\tudp"
  746. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  747. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  748. } | column -s $'\t' -t
  749. }
  750. fn_info_message_jk2(){
  751. echo -e "netstat -atunp | grep jk2mvded"
  752. echo -e ""
  753. {
  754. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  755. echo -e "> Game\tINBOUND\t${port}\tudp"
  756. } | column -s $'\t' -t
  757. }
  758. fn_info_message_justcause2(){
  759. echo -e "netstat -atunp | grep Jcmp-Server"
  760. echo -e ""
  761. {
  762. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  763. echo -e "> Game\tINBOUND\t${port}\tudp"
  764. } | column -s $'\t' -t
  765. }
  766. fn_info_message_justcause3(){
  767. echo -e "netstat -atunp | grep Server"
  768. echo -e ""
  769. {
  770. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  771. echo -e "> Game\tINBOUND\t${port}\tudp"
  772. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  773. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  774. } | column -s $'\t' -t
  775. }
  776. fn_info_message_minecraft(){
  777. echo -e "netstat -atunp | grep java"
  778. echo -e ""
  779. {
  780. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  781. echo -e "> Game\tINBOUND\t${port}\ttcp"
  782. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  783. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  784. } | column -s $'\t' -t
  785. }
  786. fn_info_message_minecraft_bedrock(){
  787. echo -e "netstat -atunp | grep bedrock_serv"
  788. echo -e ""
  789. {
  790. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  791. echo -e "> Game\tINBOUND\t${port}\tudp"
  792. echo -e "> Game\tINBOUND\t${port6}\tudp6"
  793. } | column -s $'\t' -t
  794. }
  795. fn_info_message_onset(){
  796. echo -e "netstat -atunp | grep OnsetServer"
  797. echo -e ""
  798. {
  799. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  800. echo -e "> Game\tINBOUND\t${port}\tudp"
  801. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  802. echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
  803. } | column -s $'\t' -t
  804. }
  805. fn_info_message_mohaa(){
  806. echo -e "netstat -atunp | grep mohaa_lnxded"
  807. echo -e ""
  808. {
  809. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  810. echo -e "> Game\tINBOUND\t${port}\tudp"
  811. } | column -s $'\t' -t
  812. }
  813. fn_info_message_mom(){
  814. echo -e "netstat -atunp | grep MemoriesOfMar"
  815. echo -e ""
  816. {
  817. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  818. echo -e "> Game\tINBOUND\t${port}\tudp"
  819. echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
  820. } | column -s $'\t' -t
  821. }
  822. fn_info_message_mumble(){
  823. echo -e "netstat -atunp | grep murmur"
  824. echo -e ""
  825. {
  826. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  827. echo -e "> Voice\tINBOUND\t${port}\tudp"
  828. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  829. } | column -s $'\t' -t
  830. }
  831. fn_info_message_pstbs(){
  832. echo -e "netstat -atunp | grep PostScriptum"
  833. echo -e ""
  834. {
  835. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  836. echo -e "> Game\tINBOUND\t${port}\tudp"
  837. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  838. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  839. } | column -s $'\t' -t
  840. }
  841. fn_info_message_projectcars(){
  842. echo -e "netstat -atunp | grep DedicatedS"
  843. echo -e ""
  844. {
  845. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  846. echo -e "> Game\tINBOUND\t${port}\tudp"
  847. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  848. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  849. } | column -s $'\t' -t
  850. }
  851. fn_info_message_projectzomboid(){
  852. echo -e "netstat -atunp | grep ProjectZomb"
  853. echo -e ""
  854. {
  855. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  856. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  857. } | column -s $'\t' -t
  858. }
  859. fn_info_message_quake(){
  860. echo -e "netstat -atunp | grep mvdsv"
  861. echo -e ""
  862. {
  863. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  864. echo -e "> Game\tINBOUND\t${port}\tudp"
  865. } | column -s $'\t' -t
  866. }
  867. fn_info_message_quake2(){
  868. echo -e "netstat -atunp | grep quake2"
  869. echo -e ""
  870. {
  871. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  872. echo -e "> Game\tINBOUND\t${port}\tudp"
  873. } | column -s $'\t' -t
  874. }
  875. fn_info_message_quake3(){
  876. echo -e "netstat -atunp | grep q3ded"
  877. echo -e ""
  878. {
  879. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  880. echo -e "> Game\tINBOUND\t${port}\tudp"
  881. } | column -s $'\t' -t
  882. }
  883. fn_info_message_quakelive(){
  884. echo -e "netstat -atunp | grep qzeroded"
  885. echo -e ""
  886. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  887. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  888. echo -e ""
  889. fi
  890. {
  891. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  892. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  893. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  894. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  895. } | column -s $'\t' -t
  896. }
  897. fn_info_message_arma3(){
  898. echo -e "netstat -atunp | grep arma3server"
  899. echo -e ""
  900. # Default port
  901. if [ -z "${port}" ]; then
  902. port="2302"
  903. fi
  904. {
  905. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  906. echo -e "> Game\tINBOUND\t${port}\tudp"
  907. # Don't do arithmetics if ever the port wasn't a numeric value
  908. if [ "${port}" -eq "${port}" ]; then
  909. echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp"
  910. echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
  911. echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
  912. fi
  913. } | column -s $'\t' -t
  914. }
  915. fn_info_message_bf1942(){
  916. echo -e "netstat -atunp | grep bf1942_lnxd"
  917. echo -e ""
  918. {
  919. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  920. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  921. echo -e "> Query Steam\tINBOUND\t${queryport}\tudp"
  922. } | column -s $'\t' -t
  923. }
  924. fn_info_message_bfv(){
  925. echo -e "netstat -atunp | grep bfv_linded"
  926. echo -e ""
  927. {
  928. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  929. echo -e "> Game\tINBOUND\t${port}\tudp"
  930. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  931. } | column -s $'\t' -t
  932. }
  933. fn_info_message_risingworld(){
  934. echo -e "netstat -atunp | grep java"
  935. echo -e ""
  936. {
  937. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  938. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  939. echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp"
  940. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  941. } | column -s $'\t' -t
  942. }
  943. fn_info_message_rtcw(){
  944. echo -e "netstat -atunp | grep iowolfded"
  945. echo -e ""
  946. {
  947. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  948. echo -e "> Game\tINBOUND\t${port}\tudp"
  949. } | column -s $'\t' -t
  950. }
  951. fn_info_message_rust(){
  952. echo -e "netstat -atunp | grep Rust"
  953. echo -e ""
  954. {
  955. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  956. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  957. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  958. } | column -s $'\t' -t
  959. }
  960. fn_info_message_samp(){
  961. echo -e "netstat -atunp | grep samp03svr"
  962. echo -e ""
  963. {
  964. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  965. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  966. } | column -s $'\t' -t
  967. }
  968. fn_info_message_sbots(){
  969. echo -e "netstat -atunp | grep blank1"
  970. echo -e ""
  971. {
  972. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  973. echo -e "> Game\tINBOUND\t${port}\tudp"
  974. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  975. } | column -s $'\t' -t
  976. }
  977. fn_info_message_sdtd(){
  978. fn_info_message_password_strip
  979. echo -e "netstat -atunp | grep 7DaysToDie"
  980. echo -e ""
  981. {
  982. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  983. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  984. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  985. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  986. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  987. } | column -s $'\t' -t
  988. echo -e ""
  989. echo -e "${lightgreen}${gamename} Web Admin${default}"
  990. fn_messages_separator
  991. {
  992. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  993. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  994. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  995. } | column -s $'\t' -t
  996. echo -e ""
  997. echo -e "${lightgreen}${gamename} Telnet${default}"
  998. fn_messages_separator
  999. {
  1000. echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
  1001. echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}"
  1002. echo -e "${lightblue}Telnet password:\t${default}${telnetpass}"
  1003. } | column -s $'\t' -t
  1004. }
  1005. fn_info_message_sof2(){
  1006. echo -e "netstat -atunp | grep sof2ded"
  1007. echo -e ""
  1008. {
  1009. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1010. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1011. } | column -s $'\t' -t
  1012. }
  1013. fn_info_message_source(){
  1014. echo -e "netstat -atunp | grep srcds_linux"
  1015. echo -e ""
  1016. {
  1017. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1018. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  1019. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  1020. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  1021. } | column -s $'\t' -t
  1022. }
  1023. fn_info_message_spark(){
  1024. fn_info_message_password_strip
  1025. echo -e "netstat -atunp | grep server_linux"
  1026. echo -e ""
  1027. {
  1028. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1029. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  1030. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1031. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  1032. } | column -s $'\t' -t
  1033. echo -e ""
  1034. echo -e "${lightgreen}${servername} Web Admin${default}"
  1035. fn_messages_separator
  1036. {
  1037. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html"
  1038. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1039. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1040. } | column -s $'\t' -t
  1041. }
  1042. fn_info_message_squad(){
  1043. echo -e "netstat -atunp | grep SquadServer"
  1044. echo -e ""
  1045. {
  1046. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1047. echo -e "> Game\tINBOUND\t${port}\tudp"
  1048. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1049. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1050. } | column -s $'\t' -t
  1051. }
  1052. fn_info_message_starbound(){
  1053. echo -e "netstat -atunp | grep starbound"
  1054. echo -e ""
  1055. {
  1056. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1057. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1058. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  1059. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1060. } | column -s $'\t' -t
  1061. }
  1062. fn_info_message_stationeers(){
  1063. echo -e "netstat -atunp | grep rocketstation"
  1064. echo -e ""
  1065. {
  1066. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1067. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1068. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  1069. } | column -s $'\t' -t
  1070. }
  1071. fn_info_message_teamspeak3(){
  1072. echo -e "netstat -atunp | grep ts3server"
  1073. echo -e ""
  1074. {
  1075. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1076. echo -e "> Voice\tINBOUND\t${port}\tudp"
  1077. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  1078. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  1079. } | column -s $'\t' -t
  1080. }
  1081. fn_info_message_teeworlds(){
  1082. echo -e "netstat -atunp | grep teeworlds"
  1083. echo -e ""
  1084. {
  1085. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1086. echo -e "> Game\Query\tINBOUND\t${port}\ttcp"
  1087. } | column -s $'\t' -t
  1088. }
  1089. fn_info_message_terraria(){
  1090. echo -e "netstat -atunp | grep Terraria"
  1091. echo -e ""
  1092. {
  1093. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1094. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1095. } | column -s $'\t' -t
  1096. }
  1097. fn_info_message_towerunite(){
  1098. echo -e "netstat -atunp | grep TowerServer"
  1099. echo -e ""
  1100. {
  1101. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1102. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1103. # Don't do arithmetics if ever the port wasn't a numeric value
  1104. if [ "${port}" -eq "${port}" ]; then
  1105. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  1106. fi
  1107. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1108. } | column -s $'\t' -t
  1109. }
  1110. fn_info_message_unreal(){
  1111. fn_info_message_password_strip
  1112. echo -e "netstat -atunp | grep ucc-bin"
  1113. echo -e ""
  1114. {
  1115. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  1116. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  1117. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1118. if [ "${engine}" == "unreal" ]; then
  1119. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  1120. fi
  1121. if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then
  1122. echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
  1123. fi
  1124. if [ "${appid}" == "215360" ]; then
  1125. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  1126. else
  1127. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  1128. fi
  1129. if [ "${appid}" ]; then
  1130. if [ "${appid}" == "223250" ]; then
  1131. echo -e "< Steam\tINBOUND\t20610\tudp"
  1132. else
  1133. echo -e "< Steam\tINBOUND\t20660\tudp"
  1134. fi
  1135. fi
  1136. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1137. } | column -s $'\t' -t
  1138. echo -e ""
  1139. echo -e "${lightgreen}${servername} Web Admin${default}"
  1140. fn_messages_separator
  1141. {
  1142. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1143. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1144. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1145. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1146. } | column -s $'\t' -t
  1147. }
  1148. fn_info_message_unreal2(){
  1149. fn_info_message_password_strip
  1150. echo -e "netstat -atunp | grep ucc-bin"
  1151. echo -e ""
  1152. {
  1153. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  1154. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  1155. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1156. if [ "${appid}" != "223250" ]; then
  1157. echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
  1158. fi
  1159. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1160. } | column -s $'\t' -t
  1161. echo -e ""
  1162. echo -e "${lightgreen}${servername} Web Admin${default}"
  1163. fn_messages_separator
  1164. {
  1165. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1166. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1167. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1168. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1169. } | column -s $'\t' -t
  1170. }
  1171. fn_info_message_unreal3(){
  1172. fn_info_message_password_strip
  1173. echo -e "netstat -atunp | grep ut3-bin"
  1174. echo -e ""
  1175. {
  1176. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1177. echo -e "> Game\tINBOUND\t${port}\tudp"
  1178. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1179. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1180. } | column -s $'\t' -t
  1181. echo -e ""
  1182. echo -e "${lightgreen}${servername} Web Admin${default}"
  1183. fn_messages_separator
  1184. {
  1185. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1186. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1187. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1188. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1189. } | column -s $'\t' -t
  1190. }
  1191. fn_info_message_unturned(){
  1192. echo -e "netstat -atunp | grep Unturned"
  1193. echo -e ""
  1194. {
  1195. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1196. echo -e "> Game\tINBOUND\t${port}\tudp"
  1197. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1198. } | column -s $'\t' -t
  1199. }
  1200. fn_info_message_ut(){
  1201. echo -e "netstat -atunp | grep UE4Server"
  1202. echo -e ""
  1203. {
  1204. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1205. echo -e "> Game\tINBOUND\t${port}\tudp"
  1206. } | column -s $'\t' -t
  1207. }
  1208. fn_info_message_kf2(){
  1209. fn_info_message_password_strip
  1210. echo -e "netstat -atunp | grep KFGame"
  1211. echo -e ""
  1212. {
  1213. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1214. echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
  1215. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1216. echo -e "> Steam\tINBOUND\t20560\tudp"
  1217. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1218. } | column -s $'\t' -t
  1219. echo -e ""
  1220. echo -e "${lightgreen}${servername} Web Admin${default}"
  1221. fn_messages_separator
  1222. {
  1223. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1224. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1225. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1226. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1227. } | column -s $'\t' -t
  1228. }
  1229. fn_info_message_wolfensteinenemyterritory(){
  1230. echo -e "netstat -atunp | grep etded"
  1231. echo -e ""
  1232. {
  1233. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1234. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1235. } | column -s $'\t' -t
  1236. }
  1237. fn_info_message_wurmunlimited(){
  1238. echo -e "netstat -atunp | grep WurmServer"
  1239. echo -e ""
  1240. {
  1241. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1242. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1243. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1244. } | column -s $'\t' -t
  1245. }
  1246. fn_info_message_mta(){
  1247. echo -e "netstat -atunp | grep mta-server"
  1248. echo -e ""
  1249. {
  1250. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1251. echo -e "> Game/Query\tOUTBOUND\t${port}\tudp"
  1252. echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
  1253. if [ "${ase}" == "Enabled" ]; then
  1254. echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp"
  1255. fi
  1256. } | column -s $'\t' -t
  1257. }
  1258. fn_info_message_mordhau(){
  1259. echo -e "netstat -atunp | grep Mord"
  1260. echo -e ""
  1261. {
  1262. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1263. echo -e "> Game\tINBOUND\t${port}\tudp"
  1264. echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
  1265. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1266. } | column -s $'\t' -t
  1267. }
  1268. fn_info_message_barotrauma(){
  1269. echo -e "netstat -atunp | grep /./Server.bin"
  1270. echo -e ""
  1271. {
  1272. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1273. echo -e "> Game\tINBOUND\t${port}\tudp"
  1274. echo -e "> Query\tINBOUND\t$((port+1))\tudp"
  1275. } | column -s $'\t' -t
  1276. }
  1277. fn_info_message_soldat() {
  1278. echo -e "netstat -atunp | grep soldat"
  1279. echo -e ""
  1280. {
  1281. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1282. echo -e "> Game\tINBOUND\t${port}\tudp"
  1283. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1284. echo -e "> FILES\tINBOUND\t$((port+10))\ttcp"
  1285. } | column -s $'\t' -t
  1286. }
  1287. fn_info_message_warfork(){
  1288. echo -e "netstat -atunp | grep wf_server"
  1289. echo -e ""
  1290. {
  1291. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1292. echo -e "> Game\tINBOUND\t${port}\tudp"
  1293. echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
  1294. } | column -s $'\t' -t
  1295. }
  1296. fn_info_message_pavlovvr(){
  1297. echo "netstat -atunp | grep Pavlov"
  1298. echo -e ""
  1299. {
  1300. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  1301. echo -e "> Game\tINBOUND\t${port}\tudp"
  1302. echo -e "> Game\tINBOUND\t$((port+400))\tudp"
  1303. } | column -s $'\t' -t
  1304. }
  1305. fn_info_message_select_engine(){
  1306. # Display details depending on game or engine.
  1307. if [ "${shortname}" == "ac" ]; then
  1308. fn_info_message_assettocorsa
  1309. elif [ "${shortname}" == "ark" ]; then
  1310. fn_info_message_ark
  1311. elif [ "${shortname}" == "av" ]; then
  1312. fn_info_message_avorion
  1313. elif [ "${shortname}" == "arma3" ]; then
  1314. fn_info_message_arma3
  1315. elif [ "${shortname}" == "bo" ]; then
  1316. fn_info_message_ballisticoverkill
  1317. elif [ "${shortname}" == "bt" ]; then
  1318. fn_info_message_barotrauma
  1319. elif [ "${shortname}" == "bt1944" ]; then
  1320. fn_info_message_battalion1944
  1321. elif [ "${shortname}" == "cmw" ]; then
  1322. fn_info_message_chivalry
  1323. elif [ "${shortname}" == "cod" ]; then
  1324. fn_info_message_cod
  1325. elif [ "${shortname}" == "coduo" ]; then
  1326. fn_info_message_coduo
  1327. elif [ "${shortname}" == "cod2" ]; then
  1328. fn_info_message_cod2
  1329. elif [ "${shortname}" == "cod4" ]; then
  1330. fn_info_message_cod4
  1331. elif [ "${shortname}" == "codwaw" ]; then
  1332. fn_info_message_codwaw
  1333. elif [ "${shortname}" == "dst" ]; then
  1334. fn_info_message_dst
  1335. elif [ "${shortname}" == "eco" ]; then
  1336. fn_info_message_eco
  1337. elif [ "${shortname}" == "etl" ]; then
  1338. fn_info_message_etlegacy
  1339. elif [ "${shortname}" == "fctr" ]; then
  1340. fn_info_message_factorio
  1341. elif [ "${shortname}" == "hw" ]; then
  1342. fn_info_message_hurtworld
  1343. elif [ "${shortname}" == "inss" ]; then
  1344. fn_info_message_inss
  1345. elif [ "${shortname}" == "jk2" ]; then
  1346. fn_info_message_jk2
  1347. elif [ "${shortname}" == "jc2" ]; then
  1348. fn_info_message_justcause2
  1349. elif [ "${shortname}" == "jc3" ]; then
  1350. fn_info_message_justcause3
  1351. elif [ "${shortname}" == "kf2" ]; then
  1352. fn_info_message_kf2
  1353. elif [ "${shortname}" == "mcb" ]; then
  1354. fn_info_message_minecraft_bedrock
  1355. elif [ "${shortname}" == "onset" ]; then
  1356. fn_info_message_onset
  1357. elif [ "${shortname}" == "mom" ]; then
  1358. fn_info_message_mom
  1359. elif [ "${shortname}" == "pz" ]; then
  1360. fn_info_message_projectzomboid
  1361. elif [ "${shortname}" == "pstbs" ]; then
  1362. fn_info_message_pstbs
  1363. elif [ "${shortname}" == "pc" ]; then
  1364. fn_info_message_projectcars
  1365. elif [ "${shortname}" == "qw" ]; then
  1366. fn_info_message_quake
  1367. elif [ "${shortname}" == "q2" ]; then
  1368. fn_info_message_quake2
  1369. elif [ "${shortname}" == "q3" ]; then
  1370. fn_info_message_quake3
  1371. elif [ "${shortname}" == "ql" ]; then
  1372. fn_info_message_quakelive
  1373. elif [ "${shortname}" == "samp" ]; then
  1374. fn_info_message_samp
  1375. elif [ "${shortname}" == "sdtd" ]; then
  1376. fn_info_message_sdtd
  1377. elif [ "${shortname}" == "squad" ]; then
  1378. fn_info_message_squad
  1379. elif [ "${shortname}" == "st" ]; then
  1380. fn_info_message_stationeers
  1381. elif [ "${shortname}" == "sof2" ]; then
  1382. fn_info_message_sof2
  1383. elif [ "${shortname}" == "sol" ]; then
  1384. fn_info_message_soldat
  1385. elif [ "${shortname}" == "sb" ]; then
  1386. fn_info_message_starbound
  1387. elif [ "${shortname}" == "sbots" ]; then
  1388. fn_info_message_sbots
  1389. elif [ "${shortname}" == "terraria" ]; then
  1390. fn_info_message_terraria
  1391. elif [ "${shortname}" == "ts3" ]; then
  1392. fn_info_message_teamspeak3
  1393. elif [ "${shortname}" == "tu" ]; then
  1394. fn_info_message_towerunite
  1395. elif [ "${shortname}" == "tw" ]; then
  1396. fn_info_message_teeworlds
  1397. elif [ "${shortname}" == "unt" ]; then
  1398. fn_info_message_unturned
  1399. elif [ "${shortname}" == "ut" ]; then
  1400. fn_info_message_ut
  1401. elif [ "${shortname}" == "mc" ]; then
  1402. fn_info_message_minecraft
  1403. elif [ "${shortname}" == "mh" ]; then
  1404. fn_info_message_mordhau
  1405. elif [ "${shortname}" == "mohaa" ]; then
  1406. fn_info_message_mohaa
  1407. elif [ "${shortname}" == "mta" ]; then
  1408. fn_info_message_mta
  1409. elif [ "${shortname}" == "mumble" ]; then
  1410. fn_info_message_mumble
  1411. elif [ "${shortname}" == "bf1942" ]; then
  1412. fn_info_message_bf1942
  1413. elif [ "${shortname}" == "bfv" ]; then
  1414. fn_info_message_bfv
  1415. elif [ "${shortname}" == "rtcw" ]; then
  1416. fn_info_message_rtcw
  1417. elif [ "${shortname}" == "pvr" ]; then
  1418. fn_info_message_pavlovvr
  1419. elif [ "${shortname}" == "rust" ]; then
  1420. fn_info_message_rust
  1421. elif [ "${shortname}" == "wf" ]; then
  1422. fn_info_message_warfork
  1423. elif [ "${shortname}" == "wurm" ]; then
  1424. fn_info_message_wurmunlimited
  1425. elif [ "${shortname}" == "rw" ]; then
  1426. fn_info_message_risingworld
  1427. elif [ "${shortname}" == "wet" ]; then
  1428. fn_info_message_wolfensteinenemyterritory
  1429. elif [ "${engine}" == "goldsrc" ]; then
  1430. fn_info_message_goldsrc
  1431. elif [ "${engine}" == "source" ]; then
  1432. fn_info_message_source
  1433. elif [ "${engine}" == "spark" ]; then
  1434. fn_info_message_spark
  1435. elif [ "${engine}" == "unreal" ]; then
  1436. fn_info_message_unreal
  1437. elif [ "${engine}" == "unreal2" ]; then
  1438. fn_info_message_unreal2
  1439. elif [ "${engine}" == "unreal3" ]; then
  1440. fn_info_message_unreal3
  1441. else
  1442. fn_print_error_nl "Unable to detect server engine."
  1443. fi
  1444. }
  1445. # Separator is different for details
  1446. fn_messages_separator(){
  1447. if [ "${commandname}" == "details" ]; then
  1448. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  1449. else
  1450. echo -e "================================="
  1451. fi
  1452. }
  1453. # Removes the passwords form all but details
  1454. fn_info_message_password_strip(){
  1455. if [ "${commandname}" != "DETAILS" ]; then
  1456. if [ "${serverpassword}" ]; then
  1457. serverpassword="********"
  1458. fi
  1459. if [ "${rconpassword}" ]; then
  1460. rconpassword="********"
  1461. fi
  1462. if [ "${adminpassword}" ]; then
  1463. adminpassword="********"
  1464. fi
  1465. if [ "${statspassword}" ]; then
  1466. statspassword="********"
  1467. fi
  1468. if [ "${webadminpass}" ]; then
  1469. webadminpass="********"
  1470. fi
  1471. if [ "${telnetpass}" ]; then
  1472. telnetpass="********"
  1473. fi
  1474. if [ "${wsapikey}" ]; then
  1475. wsapikey="********"
  1476. fi
  1477. if [ "${gslt}" ]; then
  1478. gslt="********"
  1479. fi
  1480. fi
  1481. }